Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

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: Multisite Admin Bar Search Pagination

share|improve this answer
    
Ah, excellent. I was able to find a work around but it was messy. Glad to see it's getting fixed. –  Pippin Oct 15 '11 at 17:29
add comment

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.

share|improve this answer
1  
No. Never change core files. –  Pippin May 23 '12 at 2:02
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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