Viewing 15 replies - 1 through 15 (of 20 total)
  • Thread Starter dailyjapan

    (@dailyjapan)

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

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

    Moderator James Huff

    (@macmanx)

    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>

    Thread Starter dailyjapan

    (@dailyjapan)

    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?

    Moderator James Huff

    (@macmanx)

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

    Thread Starter dailyjapan

    (@dailyjapan)

    I dont have any plugins enabled…

    Thread Starter dailyjapan

    (@dailyjapan)

    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?

    Thread Starter dailyjapan

    (@dailyjapan)

    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

    Thread Starter dailyjapan

    (@dailyjapan)

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

    Thread Starter dailyjapan

    (@dailyjapan)

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

    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.

    Thread Starter dailyjapan

    (@dailyjapan)

    Are you using netfirms as well?

    Thread Starter dailyjapan

    (@dailyjapan)

    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?

    Thread Starter dailyjapan

    (@dailyjapan)

    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! ??

    https://www.dailyjapan.com

    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!

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Previous Page – Next Page not working…’ is closed to new replies.