WordPress.org

Ready to get started?Download WordPress

Forums

Previous/Next Posts still not working (7 posts)

  1. mailer_diablo
    Member
    Posted 9 years ago #

    My blog's address is http://www.PlanetKH.com , which points to http://www.union-atlantic.com/planetkh/ . The "previous entries" link points to http://www.planetkh.com/planetkh/index.php?paged=2 , which means it is redirect to http://www.union-atlantic.com/planetkh/planetkh/index.php?paged=2 which goes nowhere and produces a 404.

    I looked at the previous thread with the same problem :

    http://wordpress.org/support/topic/33704

    followed the instructions, at first I thought the problem was solved when the "previous entries" link worked at index.php.

    However, http://www1.planetkh.com/?cat=1 and http://www1.planetkh.com/index.php?paged=2 still has the problem for both 'next entries' and 'previous entries' links. How should I continue from here? Thanks in advance!

  2. schun
    Member
    Posted 9 years ago #

    I had a same problem, but this is how I fixed it.

    In the file: template-functions-links.php
    Find the function: get_pagenum_link($pagenum = 1),
    Change $qstr = $_SERVER['REQUEST_URI'];
    to $qstr = $_POST['REQUEST_URI'];

    I believe this is caused by the php version that you are running in your server.

    Hope this will fix your problem!

  3. jennavery42
    Member
    Posted 8 years ago #

    I tried this fix, but it isn't working for me. My "previous entries" link at the bottom of my main page still brings up the current entries only. (Does work on individual post pages.) Any thoughts? Here is my blog: http://www.highlysensitivesouls.com/blog.

  4. Jimflexx
    Member
    Posted 8 years ago #

    I got the same problem as you, using 1.5.2. I went to your site (nice site, by the way) and noticed that when you go to category, and get a list, "previous entries" show up with the link:
    http://www.highlysensitivesouls.com/blog/?cat=10&paged=2
    I believe there should be an index.php before the ?cat.

    You have set up some kind of fix that redirects back to the previously displayed page, probably when it hits the 404.

    On mine, http://www.dmhaven.com/blog , when you click a category, any category, you get a previous entries link missing the index.php, like this:
    http://www.dmhaven.com/blog/?cat=4&paged=2
    Clicking the link displays a Not Found message.

    I shut down permalinks and deleted .htaccess, so that should not be a factor.

    There is another slightly different problem on the main page. The previous entry works on the main page. You can click the previous entry until you reach the first post. At this point, there should be no previous post, but it shows up anyway:
    http://www.dmhaven.com/blog/index.php?paged=4
    When you click there, you get a Not Found message, and a search box.

    Any help would be appreciated.

  5. Jimflexx
    Member
    Posted 8 years ago #

    Did some more testing. The problem goes away when I change the Options/Reading/Blog Pages from 1 per day to 10 per post. It's working fine now, and I'm moderately happy. I would like to have the per day feature, but not if it causes problems.

    I don't have enough entries yet to do further testing, but it looks like a bug that needs to be hunted down.

    p.s. I put permalinks back up, so some of the info in the post above may not apply.

  6. silfani
    Member
    Posted 7 years ago #

    GOT IT!

    It's ugly but it works. To get rid of the redundant subdomain, just subtract that part of the $index and $qstr strings that is giving the problems.

    To see what they originally were getting, I ran a trace script on the $_SERVER calls in the get_pagenum_link function:


    <?php
    echo $_SERVER['REQUEST_URI'];
    echo $_SERVER['PHP_SELF'];
    ?>

    This gave the orginating file as well as the subdomain. BINGO!

    Thus to lines 377 to 398 of template_functions_links.php, I added a substr php command to excise this problematic subdomain:


    $qstr = wp_specialchars($_SERVER['REQUEST_URI']);
    $qstr = substr ($qstr, 8);
    ...
    $index = $_SERVER['PHP_SELF'];
    $index = substr ($index, 6);

    The discrepancy in the substr calls are because I am getting %7E in $qstr, two characters more than the regular single ~ in $index.

    Thus in general, for $qstr, the number should be the length of subdomain name + 4, and for $index it should be +2.

    This seems to have cleared up other 404 errors originating from the login as well as all instances of previous/next entries misdirection.

  7. Seaborn
    Member
    Posted 7 years ago #

    Would this fix the problem in my earlier post?

    http://wordpress.org/support/topic/80751?replies=8

Topic Closed

This topic has been closed to new replies.

About this Topic