• Hi there!
    After spending hours in agony and pain, I have to ask you guys about the problem I have:
    On my homepage, I want to display the 5 recent posts in fulltext (standard WordPress), and on the bottom of my page, I want to have the 5 previously posts (post 6 to 10 – only the titles and the links).

    How should I do that?

    I’ve tried setting the settings to show the 10 last posts, and post 6 to 10 I’m using the get_permalink instead of the_permalink. On the homepage, it works fine. But, when viewing page 2, well, it’s a pain! Page 2 shows posts 10-15 in fulltext and posts 16-20 with only the title – see my problem? I can’t view the posts 6-10 in fulltext with posts 11-15 with only the titles..

Viewing 1 replies (of 1 total)
  • Have you checked out the Codex – The Loop. Look at the multiple loops section.

    Use the query_posts() function to grab only the specific posts (e.g. limit the first loop to five posts, then in the second post, grab five more posts with an offset of five.)

    On the homepage, it works fine. But, when viewing page 2, well, it’s a pain! Page 2 shows posts 10-15 in fulltext and posts 16-20 with only the title – see my problem? I can’t view the posts 6-10 in fulltext with posts 11-15 with only the titles..

    Then you need to use conditional statements. Put the front page content inside an if (is_front_page()) { ... } statement. Then, put the format you want for page 2, 3, 4, etc. inside an else statement immediately after the if statement.

    The is_front_page() function is new to WP 2.5 . Right now, I’m still using if (is_home() && !is_paged()) which seems to do the trick, so if the is_front_page() function doesn’t work out try the (is_home…) instead.

    If you aren’t familiar with conditional statements, then please look around the net for a basic PHP tutorial, or at least look at the Working Examples on the Codex page for Conditional Tags.

Viewing 1 replies (of 1 total)
  • The topic ‘query_posts – more results’ is closed to new replies.