• I have a wordpress Page created which lists the top 1 item in category ‘x-of-the-day’. If I have the php function to print out Next and Previous items do I need to do something special??

    I have:

    <?php posts_nav_link(‘ – ‘,’« Prev’,’Next »’); ?>

    However, when I click Next from this Page on the first page the URL shows wordpressPage/page/2/ but the content doesn’t change! Do i need to specify the category?? If so, how?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter yeago

    (@yeago)

    https://www.ads-software.com/extend/plugins/page2cat/

    Is it related to this? I really need some feedback here =)

    Thread Starter yeago

    (@yeago)


    <?php query_posts('posts_per_page=1&category_name=categoryNAME&offset='.$_GET['offset']); ?>

    and then

    <?php
    
    //Hack I used.
    
    if($_GET['offset'] == "" || $_GET['offset'] < 1){
        echo "<a href='?offset=1'>Next »</a>";
    }else{
        $next = $_GET['offset'] + 1;
        $prev = $_GET['offset'] - 1;
        echo "<a href='?offset=" . $prev . "'>« Previous</a>";
        echo " - ";
        echo "<a href='?offset=" . $next . "'>Next »</a>";
    }
    ?>
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Next and Previous don’t work?!’ is closed to new replies.