Grow your CSS skills. Land your dream job.

integrating wordpress latest posts into home page

  • cjk
    # October 9, 2008 at 10:35 am

    hi,
    I am looking for opinions and ideas on the best and simplest methods to accomplish the following;

    I currently have a wordpress installation at mydomain.com/blog and a simple home page with logo, some pictures and an "enter" link to the blog. I have a number of posts and several static pages in wp. I would like to expand on my static pages and take many of them outside of wp. I wish to keep using so for my "news" blogging but would like to create a sidebar on my new homepage (and other static HTML/css pages) that has a dynamic update of the latest 5 or more blog posts.

    I am sure that there is more than one way to skin this cat. What would you do, and why?

    Cheers!
    Chris

    # October 9, 2008 at 1:49 pm

    I’d use SimplePie to grab the RSS feed from your blog area and display the headlines on static pages.

    http://simplepie.org/

    cjk
    # October 9, 2008 at 3:07 pm

    Hey Chris,
    Simple Pie rings a bell. Didn’t you include it in one of your screencasts?

    # October 9, 2008 at 3:36 pm

    I’ve always had good success with magpierss.

    # November 28, 2008 at 4:28 am

    I am a total wordpress newbie, but am trying to build my first theme from scratch. I am trying to figure this Simplepie plugin out from video #41, but am pulling my hair out.

    When i added the code from the video to my index.php, I get this message:

    A feed could not be found at http://localhost:8888/wordpress/feed/

    Does anyone have any ideas? You help would be greatly appreciated. Feel free to ask for more info if you think it will help. I am testing my theme locally with MAMP. Not sure if this is relevant, but I am still at the stage where I the only pages I am working with are index.php and style.php. I haven’t parsed the theme into header, footer, sidebar, etc.

    # November 28, 2008 at 12:53 pm

    I would think there is just something a part of that SimplePie plugin that requires the site to be on a real server on the real internet. I’m almost certain it has something to do with the fact you are working locally. Maybe leave that part of the design/testing until you have somewhere to test online.

    pab
    # November 28, 2008 at 1:15 pm

    yeah like Chris said, it’s because you are working locally,

    that being said it should still display but you will have some parse errors,

    make sure you downloaded all the right plug ins for it to work.

    check out the simple pie site there’s some info on the subject.

    # November 29, 2008 at 1:37 am

    Thanks for your help Chris and Pab. I will attempt to test online tomorrow and see what happens.

    # November 30, 2008 at 12:50 pm
    "cjk" wrote:
    hi,
    I am looking for opinions and ideas on the best and simplest methods to accomplish the following;

    I currently have a wordpress installation at mydomain.com/blog and a simple home page with logo, some pictures and an "enter" link to the blog. I have a number of posts and several static pages in wp. I would like to expand on my static pages and take many of them outside of wp. I wish to keep using so for my "news" blogging but would like to create a sidebar on my new homepage (and other static HTML/css pages) that has a dynamic update of the latest 5 or more blog posts.

    I am sure that there is more than one way to skin this cat. What would you do, and why?

    Cheers!
    Chris

    I have wordpress on a client site within a resources directory, but the main page (not in that directory) has a link to an excerpt to the latest post.

    in your main html page you want to show the wordpress stuff add this PHP (to the very top) and rename the HTML page to a PHP page:

    Code:
    < ?php
    // Include WordPress
    define('WP_USE_THEMES', false);
    require('/directory_to_your_wordpress_header.php/wordpress/wp-blog-header.php');
    query_posts('showposts=1');
    ?>

    then where-ever you want the excerpt on your page place this code:

    Code:

    < ?php while (have_posts()): the_post(); ?>

    < ?php the_title(); ?>

    < ?php the_excerpt(); ?>

    ” class=”text1″>Read more…

    < ?php endwhile; ?>

    it took me nearly 3 weeks to find out how to link wordpress outwith the main loop

    # December 22, 2008 at 10:44 pm

    Ikthius,

    Incredibly useful post.

    Thanks

    Keith

    # December 23, 2008 at 2:46 am
    "keithtrx" wrote:
    Ikthius,

    Incredibly useful post.

    Thanks

    Keith

    no problem, when I was learning wordpress for a client, they wanted an excerpt of the latest post on the main index page, so I had to find out how to do it. after nearly 3 weeks of searching I eventually found this. So I am hoping that most people don’t have to search as long as I did.

    I have posted it on wordpress forum itself when I was asking them for help, but I found it outwith wordpress, so I am making it available as often as I can, to help others.

    ik

    cjk
    # March 17, 2009 at 9:47 am

    Hey Ikthius!

    Sorry for the delay, I got distracted with other projects and just got around to fiddling with my site again. Your reply was extremely useful and helpful. That was the ticket! Worked like a charm. Much appreciation!

    If anyone would like to see how that all worked out, http://www.krowchukdressage.com is the site.

    Best regards,
    Chris

Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".