WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Previous Next page (11 posts)

  1. paul1107
    Member
    Posted 4 years ago #

    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

  2. esmi
    Forum Moderator
    Posted 4 years ago #

    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.

  3. paul1107
    Member
    Posted 4 years ago #

    Hi Esmi,

    Thanks for that

    The paste bin url is as follows

    http://wordpress.pastebin.ca/1790583

    Any help would be greatly appreciated!

  4. esmi
    Forum Moderator
    Posted 4 years ago #

    That does not look like a complete template file.

  5. paul1107
    Member
    Posted 4 years ago #

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

    http://wordpress.pastebin.ca/1790661

    I hope that makes things clearer?

    Thanks

  6. esmi
    Forum Moderator
    Posted 4 years ago #

    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);
    ?>
  7. paul1107
    Member
    Posted 4 years ago #

    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.

  8. paul1107
    Member
    Posted 4 years ago #

    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

  9. esmi
    Forum Moderator
    Posted 4 years ago #

    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!

  10. Shane G.
    Member
    Posted 4 years ago #

  11. paul1107
    Member
    Posted 4 years ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Topic