The MU forums have moved to WordPress.org

Older Entries Link Has Wrong URL (6 posts)

  1. garbles
    Member
    Posted 10 years ago #

    When my blog has more than ten entries and another page is created, there is a link that appears at the bottom of the page, "Older Entries". This link should go to the next page of posts, but has the wrong URL. My blog is http://www.sep.com/pmblog and instead of "Older Entries" having the URL of http://www.sep.com/pmblog/page/2/ it has a URL of http://www.sep.com/pmblog/pmblog/page/2/

    Can someone help me figure out how the blog owner name is being inserted into that URL twice?

    Thanks

  2. dgilmour
    Member
    Posted 10 years ago #

    This sounds like a bug in your theme scripts. Try another theme.

  3. garbles
    Member
    Posted 10 years ago #

    I tried a different theme and the problem went away so in order to keep my theme and still solve the problem, I did the following:

    In the link-template.php file, I found the function get_pagenum_link() that was supplying the incorrect url. I added a check to see if the blog username was being repeated:

    $pos = strpos( $base, $request );

    if ( !($pos === false) ) {
    $request = user_trailingslashit( 'page/' . $pagenum, 'paged' );
    } else {
    $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );
    }

    This appears to have solved my problem without breaking anything else and I still get to use my theme.

    Thank you for the response and please let me know if this solution is the wrong way to approach the problem.

  4. garbles
    Member
    Posted 10 years ago #

    That code was in place of:
    $request = ( ( !empty( $request ) ) ? trailingslashit( $request ) : $request ) . user_trailingslashit( 'page/' . $pagenum, 'paged' );

  5. andrea_r
    Moderator
    Posted 10 years ago #

    Don't hack the core files. If you switched themes and it worked fine, then it wasn't WP, it was your *theme*.

    Compare the theme files and see if they call the same function. If not paste in the working one.

  6. garbles
    Member
    Posted 10 years ago #

    Actually, I was wrong about the default theme working. It turns out that the broken URL is fine when you navigate there from the admin page. But when I navigate to http://www.sep.com/pmblog from http://www.sep.com/blogs or just type in the URL, then the "Older Entries" URL is incorrect regardless of the theme I use. Strange that it works fine when I navigate from the admin page.

    I'm wondering if it is an IIS 7 URL Rewrite problem.

About this Topic