WordPress.org

Support

Support » Themes and Templates » Creating an alternate index page?

Creating an alternate index page?

  • I would like to create an alternate index page for my site but am not sure how to go about it. Ordinarily I might just duplicate the index.php (naming it something else) and edit it to my taste, but I have a problem – I only have the most recent 2 posts to displaying on my “real” index page (and these posts use the <!–more–> break to show the beginning paragraphs), but I want my alternate index page to show, say, the most recent 6 or 7 posts in full text versions… regardless of whether there are <!–more–> breaks in the posts.

    Right now I have my post display preferences (via the dashboard options) set to “2.” But how would I override that on the alternate index page, so that I could show 7 posts? And how would I override the <!–more–> break? (Should I just use an excerpt field on my posts for the main index display, rather than the <!–more–> tag?)

Viewing 2 replies - 1 through 2 (of 2 total)
  • ebedgert
    Member

    @ebedgert

    Actually, I’m still just looking for some insight on how to create an alternate index page. Something that looks and acts very similar to my current index page but can be presented as a separate page. It’s more involved than simply copying and renaming “index.php” to something else, right?

    s_ha_dum
    Member

    @apljdi

    It’s more involved than simply copying and renaming “index.php” to something else, right?

    Not much. Copy your index file. You were on the right track there. Use query_posts to override the post display limit and set $more to 1 to get full-texts. It should look like this:

    query_posts('showposts=-1');
    global $more;
    $more = 1;

    You might also be able to just put a switch inside the index file.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Creating an alternate index page?’ is closed to new replies.