• Resolved picinae

    (@picinae)


    hey, I’ve made a simple custom page template which I take in 2 categories.
    [code]<?php query_posts('cat=22,614);?>[/code]
    Everything except navigation works. I have it set to show 10 entries per page. But the previous_posts_link does not work, the page number increases, but the same items appear. How can I navigate to previously posted post in a custom page template
    [code]<div class="navigation">
    <div class="alignleft">
    <?php next_posts_link('« Older Entries') ?>
    </div>
    <div class="alignright">
    <?php previous_posts_link('Newer Entries »') ?>
    </div>
    </div>[/code]

Viewing 2 replies - 1 through 2 (of 2 total)
  • Change:

    <?php query_posts('cat=22,614);?>

    to

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    query_posts('cat=22,614&posts_per_page='.get_option('posts_per_page').'&paged=' . $paged);
    ?>

    Thread Starter picinae

    (@picinae)

    THANKS U R MY HERO!!

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

The topic ‘Navigation problem custom page template’ is closed to new replies.