RSS Feed for This PostCurrent Article

Using the Mosting Recent Post As the “Featured” Category

If you’d like to automatically have your “featured” post be your most recent blog entry, you’ll need to edit just a few lines of code in the index.php file.

You should change line 23 of the index.php file to the following:

$the_query = new WP_Query(‘&showposts=1′);

Trackback URL

  1. 2 Comment(s)

  2. By Open Road Biker on Jan 6, 2009 | Reply

    you need to show us the line we need to replace instead of just giving us a line number. I have tried that by replacing line 23 and it breaks the site.

  3. By admin on Jan 6, 2009 | Reply

    Line 23 originally looks like this:

    $the_query = new WP_Query('category_name=' . $featuredcat . '&showposts=1');

    And you should change it to look like this instead:

    $the_query = new WP_Query('&showposts=1');

Post a Comment