WordPress.org

Ready to get started?Download WordPress

Forums

1.5.1 prev - next links issue (14 posts)

  1. jofta
    Member
    Posted 9 years ago #

    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.

  2. moshu
    Member
    Posted 9 years ago #

    It works fine for me. What is the code you are using for prev-next?

  3. jofta
    Member
    Posted 9 years ago #

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

  4. moshu
    Member
    Posted 9 years ago #

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

    Explanation here

  5. jofta
    Member
    Posted 9 years ago #

    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

  6. jofta
    Member
    Posted 9 years ago #

    Nope, didn't work

    It works fine on any page other than

    http://localhost/wow/

  7. moshu
    Member
    Posted 9 years ago #

    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...

  8. jofta
    Member
    Posted 9 years ago #

    Thanks for the help..
    I'll come back when I eventually go live with it :)

  9. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

    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.

  10. Ryan Boren
    WordPress Dev
    Posted 9 years ago #

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

  11. jofta
    Member
    Posted 9 years ago #

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

  12. jofta
    Member
    Posted 9 years ago #

    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.

  13. Ming
    Member
    Posted 9 years ago #

    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

  14. twhid
    Member
    Posted 9 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags