[wp-hackers] Strange shortcode / header issue with search
casey.bisson at gmail.com
Tue Sep 25 03:19:42 UTC 2012
In addition to what Daniel suggests (and he's spot on), you might also look into what caching is going on. The pattern you describe where you get one result on initial page load and another result after a reload is common for caching errors where the result is not properly cached so that it can be output where it belongs.
Definitely start with Daniel's suggestion, a that's probably the cause of problems in the initial page load, and fixing that might fix the different result you get in the next page load.
On Sep 24, 2012, at 5:55 PM, Daniel Bachhuber <wordpress at danielbachhuber.com> wrote:
> Can you make sure the shortcode is returning its content, not echoing? This common mistake can produce results like you're seeing if the_content is applied to a post before the loop
> On Sep 24, 2012, at 17:49, Jeffrey Nolte <jnolte at getmoxied.net> wrote:
>> 1. Do a search for "television"
>> 2. I am returned a page with results for "television" with a photo gallery injected into the dom before the opening html tag via JS.
>> 3. I refresh the page and it is gone.
>> **Note: the photo gallery is a custom post type which is inserted into posts with a shortcode- there were many reasons for this approach as we needed to insert galleries into more than one post and replace a ton of flash galleries in existing content that was merged into new theme.
>> Some info about setup
>> WordPress 3.4.2
>> Relevenssi Plug-in for search
>> Running NGINX / w3 Total Cache and Varish with PHP-FPM
>> VPS Ubuntu 12.04 LTS
More information about the wp-hackers