WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] Previous Next page

[Resolved] Previous Next page

  • my site is summerdress.org.uk.

    My problem is that my previous & next pagination links do not work, upon clicking they just return to the home page. the url changes to http://www.mydomain/page/2, page/3, etc, but

    My permalinks setting is /%postname%/.

    Has anyone any ideas, as its driving crazy…

    Code moderated as per the Forum Rules

Viewing 10 replies - 1 through 10 (of 10 total)
  • esmi

    @esmi

    Forum Moderator

    You could drop a copy of the relevant template file in the WordPress pastebin and post the pastebin url here. Perhaps someone will be able to spot the problem and suggest a solution.

    Hi Esmi,

    Thanks for that

    The paste bin url is as follows

    http://wordpress.pastebin.ca/1790583

    Any help would be greatly appreciated!

    esmi

    @esmi

    Forum Moderator

    That does not look like a complete template file.

    I’ve amended the file to show the index.php homepage template

    http://wordpress.pastebin.ca/1790661

    I hope that makes things clearer?

    Thanks

    esmi

    @esmi

    Forum Moderator

    Try changing <?php query_posts('cat=-11'); ?> to:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => 11,
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    HI,

    Thanks but I’m afraid that didn’t work. The page loaded but showed my links page? I’m afraid it showed No posts so I couldn’t test the pagination.

    Just an update, but I changed the theme to Kubrik as a test, and the previous link work ok, and I can click through to previous pages.

    the url changes to mydomain.com/page/2… page/3… etc.

    When changing back to my original theme, I try the same, but even though the urls change in the same way as when testing with kubrik, the output still reverts back to the home page and shows now previous pages.

    Not sure whether that makes it any clearer for any one with suggestions?

    thnaks

    esmi

    @esmi

    Forum Moderator

    Sorry – that should have been:

    <?php
    $paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
    $args= array(
    	'cat' => -11,
    	'paged' => $paged
    );
    query_posts($args);
    ?>

    I missed the minus sign!

    Hi Esmi

    You Beauty! that seems to have worked a treat, thanks so much for your help.

    Shane G – I’ll have a look at your plugin as well.

    Thanks for your contribution

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Resolved] Previous Next page’ is closed to new replies.