Forums

Previous Page - Next Page not working... (21 posts)

  1. dailyjapan
    Member
    Posted 7 years ago #

    Hi,

    If you are on the main page of my site and click next page, it will take you to page two. But then from there it breaks down...

    http://www.dailyjapan.com/index.php?paged=2

    The links show as:

    http://www.dailyjapan.com/subdomain/dailyjapan.com///index.php?paged=3

    which obviously brings up an error that the page cannot be found.

    Any ideas what could be causing this?

  2. dailyjapan
    Member
    Posted 7 years ago #

    Any ideas? I tried upgrading to 1.5.1.1 but no luck...

  3. moshu
    Member
    Posted 7 years ago #

    For me it doesn't work even for page2.
    What is the code you are using for next-previous?

  4. James
    Happiness Engineer
    Posted 7 years ago #

    For what it's worth, I'm running v1.5.1.1 and have no problems with the previous/next links. In case it helps, here's the code from my main template:

    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
    </div>

  5. dailyjapan
    Member
    Posted 7 years ago #

    I'm using whatever the default is in the themes... I thought maybe it was the theme that I was using that was causing the problem, but I tried the default and classic themes that come with it and still had the same problem.

    Here is the code anyway:

    <?php posts_nav_link() ?>

    Thats the usual, right?

  6. James
    Happiness Engineer
    Posted 7 years ago #

    Do the links work if you disable all of your plugins?

  7. dailyjapan
    Member
    Posted 7 years ago #

    I dont have any plugins enabled...

  8. dailyjapan
    Member
    Posted 7 years ago #

    macmanx,

    I tried your code, and now it doesnt work at all even from the first page...

    Is there a setting hiding in some config file that might be making it think that its in a different location than it actually is on the server?

  9. dailyjapan
    Member
    Posted 7 years ago #

    and now that I've switched back its not working for the old code either...

    there must be something hiding telling it that its sitting at /subdomain/dailyjapan.com

  10. dailyjapan
    Member
    Posted 7 years ago #

    So nobody else has had a problem like this? Do you think it could be a problem with my host? (netfirms)

  11. dailyjapan
    Member
    Posted 7 years ago #

    still tinkering with it but no luck... I cant believe nobody else has had this problem!

  12. Jeremy Boggs
    Member
    Posted 7 years ago #

    I have the same problem, but it's low on the list of things I need to get working! If I find a solution I'll send it to you.

  13. dailyjapan
    Member
    Posted 7 years ago #

    Are you using netfirms as well?

  14. dailyjapan
    Member
    Posted 7 years ago #

    I have been trying to fix this problem, and figured if I went in and changed the function to reflect the proper URL it would work, but I'm lost when I look at the template-functions-links.php file and find:

    function posts_nav_link($sep=' — ', $prelabel='« Previous Page', $nxtlabel='Next Page »') {
    global $request, $posts_per_page, $wpdb, $max_num_pages;
    if (! is_single()) {

    if (get_query_var('what_to_show') == 'posts') {
    if ( ! isset($max_num_pages) ) {
    preg_match('#FROM (.*) GROUP BY#', $request, $matches);
    $fromwhere = $matches[1];
    $numposts = $wpdb->get_var("SELECT COUNT(ID) FROM $fromwhere");
    $max_num_pages = ceil($numposts / $posts_per_page);
    }
    } else {
    $max_num_pages = 999999;
    }

    if ($max_num_pages > 1) {
    previous_posts_link($prelabel);
    echo preg_replace('/&([^#])(?![a-z]{1,8};)/', '&$1', $sep);
    next_posts_link($nxtlabel, $max_page);
    }
    }
    }

    I cant figure out where it makes the link in there... no abspath or anything, so I'm lost.

    Can anyone help?

  15. dailyjapan
    Member
    Posted 7 years ago #

    Fixed it!!!

    Just did a little playing around with php and this solved my problem:

    function get_pagenum_link in template-functions-links.php

    I added the following under $qstr = $_SERVER['REQUEST_URI'];

    $qstr = substr($qstr,26);

    I had 26 characters showing up as extras (absolute path) so used that to get rid of them.

    I then removed $index from the line

    $qstr = $index . '?' . $page_querystring . '=' . $pagenum;

    near the bottom of the function.

    Now I have a working next and previous page on netfirms! :)

    http://www.dailyjapan.com

  16. shannon40
    Member
    Posted 6 years ago #

    Thanks much for this! I'm also a Netfirms user, and this fixed my own "previous entries" problem like a charm.

    I'd just like to add that not just "$index" should be removed from that last bit, but "$index .", leaving it looking like:

    $qstr = '?' . $page_querystring . '=' . $pagenum;

    I originally left the " ." and all hell broke loose on my blog. What fun!

  17. hendrixf
    Member
    Posted 6 years ago #

    Hello,

    I'm using netfirms and used the supplied code to make the previous and next links to work on my blog. However, when you move through the next and previous pages my photos do not load. Any help with this?

    thanks

  18. bradbice
    Member
    Posted 6 years ago #

    Awesome, this fix worked for me as well! I had a index.phpIndex.php thing going on in my previous posts url, but for some reason, this fix worked. Thanks!

  19. roundtrip
    Member
    Posted 6 years ago #

    Thanks for the fix but it still doesn't completely fix the problem. If you click on a category that has too many postings to display on the one page then the Next Page button doesn't work to display the next category page, instead viewing the normal next page of the complete blog listing.

    I'm not with the hosting providers mentioned previously so it looks like this is a bug in WP2 that is affecting some users!

    Any thoughts?

    Regards

    John

  20. roundtrip
    Member
    Posted 6 years ago #

    Should have added a link to let people see what I'm trying to say!

    http://blog.roundtripsolutions.com/category/security/

  21. roundtrip
    Member
    Posted 5 years ago #

    Changed the blog to stop using subdomains so that problem can now be seen at:

    http://www.roundtripsolutions.com/blog/category/security/

    which works fine. But hitting the Next Page link results in a WP "not found" error.

    The next page link would like to take us to:
    http://www.roundtripsolutions.com/blog/category/security/page/2/

    Anyone know the solution to fixing this one?

    Thanks for your help and assistance.

    Regards

    John

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.