Support » Fixing WordPress » Older Entries Link Has Wrong URL

Viewing 7 replies - 1 through 7 (of 7 total)
  • esmi

    (@esmi)

    Forum Moderator

    Try resetting your custom permalinks back to the default setting. If that works, then try reading Using_Permalinks before setting a custom permalink structure back up again.

    garbles

    (@garbles)

    I reset my permalinks to default and that did take care of the problem so what I ended up doing to have both my custom permalink and solve the problem is 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 my custom permalink.

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

    garbles

    (@garbles)

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

    esmi

    (@esmi)

    Forum Moderator

    Editing a core file is not usually the best way to solve a problem. Far better to try and figure out why you have a problem in the first place. Did you check your theme template files to see how the navigation links were being generated? Have you checked your Blog and Site urls in Settings/General? Have you tried deactivating all plugins or switching to the default theme? Did any of the preset permalink options work?

    garbles

    (@garbles)

    How do I find out how my navigation links are being generated? The only file in my theme folder I could see that involved the “Older Entries” link was index.php and all that did was use a method from link.template to get the url. It seems like wordpress generates the url and my theme just gets it from wordpress.

    Is it possible that I have an IIS 7 URL Rewrite problem?

    To answer your questions:
    I have tried the default theme and the problem does go away, but I don’t understand how to find the problem within my own theme as far as what files actually could cause this problem.

    The only permalink option that works is the default, the other ones also add on the blog user name to the url and goes to the wrong page.

    I checked the Site URL and it is http://www.sep.com/pmblog/ which is what I want.

    Thanks for your continued help with this.

    garbles

    (@garbles)

    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 found this thread for the same issue of “Older Entries” getting a bad URL (.com/blog/blog/?paged=#) and after reading through all of this I think I may have found a good solution for anyone else out there:

    Esmi is right:

    Did you check your theme template files to see how the navigation links were being generated? Have you checked your Blog and Site urls in Settings/General?

    I know it is the theme as I have had the problem ever since adding the theme. But because the wordpress address and site address were different, I was getting the extra blog/ in the theme. I didn’t want to pay the $68 for the theme support if I didn’t have to, so this is an alternate solution. I noticed in the theme it was creating .info/blog for the older entries and I know the .info forwards to .com/blog thus giving me .com/blog/blog I’m sure this can also be edited in the theme, but I couldn’t find it in the code and this solution fixed another issue I was having with the sitemap, so I’m happy.

    Solution: make the wordpress address and the site address the same in the Settings/General of wordpress. Forward a URL to your wordpress page a different way (like in GoDaddy).

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Older Entries Link Has Wrong URL’ is closed to new replies.