Support » Fixing WordPress » Pagination problem

  • Resolved SMae



    I am going mad trying to figure out the pagination for my front page.

    I want to display my latest single post from category 5 on my front page. I also want to be able to navigate through category 5 from the front page. Right now when there is more than one post page 2 results in a 404 error.

    My current code:
    <?php if ( is_front_page() ) {
    query_posts($query_string . ‘posts_per_page=1&cat=5’);
    } ?>

    Thank you for any help

Viewing 4 replies - 1 through 4 (of 4 total)
  • Anyone?

    you have a condition on the query (is_front_page) – what if not?
    (could you show the code of the full index.php for more details?)

    if this is not the reason for the error message, you could try including the $paged variable:

    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts($query_string . 'posts_per_page=1&cat=5&paged='.$paged);

    Thank you for your reply.

    I just worked it out. The problem was that I could get the pagination to work with conditional ‘posts_per_page=1’ or ‘&cat=5’ comments, but could not get it to work with both.

    So I downloaded the “Different Posts Per Page” plug-in and used the original code I had without the ‘posts_per_page=1’.

    <?php if ( is_front_page() ) {
    } ?>

    I am sure there is a way to do it without the plug-in but I tried for hours and couldn’t figure it out so Ill stick to this solution unless someone can tell me a better one.

    There’s a solution in the last reply..

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Pagination problem’ is closed to new replies.