• I’d like to have two versions of index.php, one for my home directory / to serve as my homepage and another within my /news/ directory to serve as my blog front page. I’ve already followed the Codex instructions for moving (in my case, a copy of) /news/index.php to /. What I’d like to do now—without changing the way /news/ works, is to have /index.php:

    1. Show only summaries and
    2. Show only entries from a particular category (“the front page”)

    Any help would be greatly appreciated. Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi

    The way you display a summary is to change the_content() to the_excerpt()

    You need to put a query_posts statement before the loop in your index.php file, to limit the display to the single category.

    You must find the category ID code for your front page category and substitute it for cat=3 in my code below

    <?php query_posts('cat=3'); ?>

    The loop starts with this code:

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

    Within the loop, change this
    the_content(

    to this
    the_excerpt(

    Leave everything on the “the_content(” line after the “(” the way it already is, just substitute the word excerpt for content

    That should do it.

    Thread Starter myhybridcarcom

    (@myhybridcarcom)

    Perfect, thanks! 🙂

    Thread Starter myhybridcarcom

    (@myhybridcarcom)

    [nevermind got it :)]

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Additional index.php With Different Display Options’ is closed to new replies.