jonathandietz
Forum Replies Created
-
Forum: Networking WordPress
In reply to: Permalink displays incorrect URL when using switch_to_blog()Awesome. I read your post and will give it a try. Thanks Simon!
I ran into this problem and found that adding wp_cache_flush() to the page you’re using switch_to_blog() on fixes the URLs.
Definitely not a fix, but just giving people options to get their URLs working again.
Forum: Networking WordPress
In reply to: Permalink displays incorrect URL when using switch_to_blog()Found the bug with Object Caching here: http://core.trac.wordpress.org/ticket/14992
Forum: Networking WordPress
In reply to: Permalink displays incorrect URL when using switch_to_blog()Thanks @jonasbjork. That put my on the right track. W3 Total Cache was recently enabled so I started looking into the W3 Total Cache / switch_to_blog correlation.
I found a function to clear the cache and a few posts of people saying this worked for them.
What I was add this
wp_cache_flush();onto my page and then the page started displaying the correct URLs. However, as soon as I removed that function the incorrect URLs return.At least I’m on the right track now 🙂
Forum: Networking WordPress
In reply to: Permalink displays incorrect URL when using switch_to_blog()I added global $switched; before switch_to_blog() but its still not working. W3 Total Cache isn’t activated for the one that is displaying the excerpts (blog-b) but it might be for the source blog (blog-a).
Just so I’m clear, switch_to_blog() does work and switches to another blog and pulls in content from the other blog. The post content is correct except for the links. All of the links in the loop point back to the blog used to display the excerpts (blog-b) even though the content is coming from another blog (blog-a)
Forum: Networking WordPress
In reply to: Permalink displays incorrect URL when using switch_to_blog()$blog_id is a variable that I’m setting elsewhere.
It is an integer and ends up being something like
switch_to_blog(1);