• If I have 5 posts on my front page, I want a small area that shows the titles of the 5 posts after it (i.e. what is on p2). How would I do this?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Just the titles?

    Thread Starter nickcatal

    (@nickcatal)

    yeah, just the titles…

    I can have the first 5 posts say $postcount++; and after it reaches 5 it would pull the next 5 immediately and print just their titles.. but if you go to page 2 it should still have those listed… and this should only be done on the main page… which I can do as is_home()

    I can think of one way to do it.

    You could modify your templates index.php. something like this (this assumes you set WP to show 10 on the post page – 5 will be shown normally then and 5 will be just titles):

    $i = 0;
    (start posts loop)
    if ($i < 5)
    process everything
    } else {
    just process title
    }
    $i++;
    (end posts loop)

    Although there has bound to be a better way than that, but it might do the job. The only problem is that the 5 titles it show might not be shown if you go to the next page. I will see if I can think of something better ??

    Thread Starter nickcatal

    (@nickcatal)

    So there is no way to call a function to simply grab 6-10? Or hell, grab 1-10 and I’ll handle it from there. ??

    Thanks.


    rewind_posts();
    $my_query = new WP_Query('showposts=10');
    while ($my_query->have_posts()) : $my_query->the_post();

    Then do your post display code. Don’t forget to

    endwhile;

    when you’re done.

    Ah, very useful function! ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Titles after ones displayed’ is closed to new replies.