Skip to:
Content
Pages
Categories
Search
Top
Bottom

Blog name twice in next_posts_link


  • peterverkooijen
    Participant

    @peterverkooijen

    Trying to fix the previous and next_posts_link in my custom theme (with messy P2 ajax stuff). I get links like this:

    http://mysite.com/yetanothertestblog/yetanothertestblog/page/2/

    It should be:

    http://mysite.com/yetanothertestblog/page/2/

    The link is created in function get_pagenum_link. I actually get the correct links when I mess up the first of these lines, by removing parts of the page/d+ stuff:

    $request = preg_replace( '|page/d+/?$|', '', $request);
    $request = preg_replace( '|^index.php|', '', $request);
    $request = ltrim($request, '/');

    But then I can’t get rid of the error messages. It’s not clear to me what that section does exactly.

    Is there a subtle way to edit that line to remove one of the two blognames?

    Other possible solutions?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi Peterverkooijen,

    You have a typo in that code snippet, missing a backslash: ‘|page/\d+/?$|’. The ‘d’ has to be escaped as in ‘\d’.

    See wp-includes\link-template.php, line 1321.

    ;)

    Man this thing really likes to strip slahes, innit?


    peterverkooijen
    Participant

    @peterverkooijen

    Thanks for the suggestion iamzippy. That backslash was originally in there, just got stripped. So that’s not the problem. The P2 theme is for a single blog, not for a WPMU blog. That has to be taken into account somehow.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Blog name twice in next_posts_link’ is closed to new replies.
Skip to toolbar