2

the CG Cookie network is running a WordPress multi site install. There is a strange bug happening with the search pagination when on any of the sub sites.

For example, if you go to http://cgcookie.com/blender/, which is one of the sub sites, and do a search for "blender", you will be taken to a search results page with about 389 items. The first page displays perfectly fine, but if you try to click over to page 2, or any of the other pages, you will be directed to a random tutorial post.

Upon closer investigation, you will notice that the url of the page numbers is of the following structure:

http://cgcookie.com/blender/blender/page/2/?s=blender

This is incorrect, and should be:

http://cgcookie.com/blender/page/2/?s=blender

So, for some reason, the site name is getting inserted into the search URL twice. If I manually remove one of the site names, and enter the correct url, everything works fine. Why is it putting two site names in the url?

It's important to note that this bug ONLY happens on the search results pagination (not on any of the archives) and it also ONLY happens when on a sub site. If you search for "blender" from the http://cgcookie.com domain, it works perfectly fine.

For the pagination, I am using the function that Kriesi wrote here. Note, however, that I do not believe it is a problem with the function, as the WP Page Numbers plugin had the exact same problem.

I ran into this problem once before, and you can see my question about it here. The fixes described there have made no difference.

Anyone have any ideas?

2 Answers 2

0

This issue has been raised as a Core Trac Ticket here: http://core.trac.wordpress.org/ticket/18034

Seems to be the same as this issue: https://wordpress.stackexchange.com/questions/30780/multisite-admin-bar-search-pagination

1
  • Ah, excellent. I was able to find a work around but it was messy. Glad to see it's getting fixed.
    – Pippin
    Commented Oct 15, 2011 at 17:29
0

Core Track Ticket fixed it, but for quick reference, change wp-includes/canonical.php, line 40, from

if ( is_trackback() || is_search() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || $is_IIS ) 

to

if ( is_trackback() || is_comments_popup() || is_admin() || !empty($_POST) || is_preview() || is_robots() || $is_IIS ) 

There are other edits in the track ticket as well.

1
  • 1
    No. Never change core files.
    – Pippin
    Commented May 23, 2012 at 2:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.