Support » Fixing WordPress » 1.5.1 prev – next links issue

  • Re 1.5 to 1.5.1 upgrade…
    I found I had to replace the template-functions-links.php with the previous 1.5 version of the that file.
    On the index page the “previous” link was spitting out /php/php?/paged=2 and this applied to a variety of themes.

    It now operates fine with “/index.php?pagd=2” using the 1.5 file

    Note, this is on a development server and not live 🙂

    Any ideas why this would happen and am I devaluing the installation by replacing this file with the previous one?
    Cheers
    John

    Apologies as this was posted in the pinned upgrade thread but got swamped by an animated discussion.

Viewing 13 replies - 1 through 13 (of 13 total)
  • It works fine for me. What is the code you are using for prev-next?

    Hi…
    I have
    <?php next_posts_link('&laquo; Previous Entries') ?>
    <?php previous_posts_link('Next Entries &raquo;') ?>

    Try this
    <?php posts_nav_link(' &nbsp; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>

    Explanation here

    I just changed the file template-functions-links.php to the 1.5.1 version and once again, no matter what theme I use I get a link as follows…
    http://localhost/wow/php/php.exe?paged=2

    Putting the 1.5 template-functions-links.php back gives me

    http://localhost/wow/index.php?paged=2

    Nope, didn’t work

    It works fine on any page other than

    http://localhost/wow/

    I didn’t try (yet) on local install, but it works with 1.5.1 updated yesterday with the code above on my online testbed…

    Thanks for the help..
    I’ll come back when I eventually go live with it 🙂

    Moderator Ryan Boren

    (@ryan)

    WordPress Dev

    In the get_pagenum_link() function, try replacing this:

    $index = $_SERVER['SCRIPT_NAME'];

    with this:

    $index = 'index.php';

    This will break paging in the edit posts page, but should fix paging elsewhere. This is just a workaround while I figure out how best to workaround environments where SCRIPT_NAME is populated with the PHP executable name.

    Moderator Ryan Boren

    (@ryan)

    WordPress Dev

    You can also try using $_SERVER['PHP_SELF'] instead of $_SERVER['SCRIPT_NAME'].

    Thanks, Ill give both a spin and report the results.

    You can also try using $_SERVER[‘PHP_SELF’] instead of $_SERVER[‘SCRIPT_NAME’].

    Seems to have fixed the problem across all themes.

    I neglected to mention that “localhost” test is based on a database conversion from B2Evolution, which went remarkably well, if that makes any difference to the issue.

    Cheers and thanks for the help.

    On Dreamhost, when your site is run as CGI, SCRIPT_NAME always refers to the PHP CGI binary. Just FYI.

    https://panel.dreamhost.com/kbase/index.cgi?area=2933

    On Dreamhost replacing $_SERVER['SCRIPT_NAME'] with $_SERVER['PHP_SELF'] in wp-includes/template-functions-links.php fixed this problem for me.

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘1.5.1 prev – next links issue’ is closed to new replies.