Whilst implementing Highlight Search Terms (HLST) plugin for a client’s website that also uses Cufon font replacement, I found that whenever the HLST plugin kicked in, the Cufon’d text disappeared.
The symptom was that Cufon fonts flash up but it looks like they then go ‘invisible’ when the HLST JS kicks in. I guessed that the insertion of the <span class="hilite">
element breaks Cufon’s ability to manipulate the DOM (or something!)?
Tried a quick fix. Whacked Cufon.refresh();
in just before the end of the jQuery document.ready function – i.e. before the last }));
in both compressed and uncompressed versions of the plugin’s JS file.
Cross-posted from: http://wordpress.org/support/topic/plugin-highlight-search-terms-this-plug-in-create-problem-with-cufon-font-replacement?replies=8#post-1921792
Hope this helps someone!
David, thanks for sharing this fix. It will likely be in the next plugin version 🙂
I suppose this will still make the Cufon fonts briefly ‘flash’ off and on again? Well, even so it’s still better than completely breaking the fonts…
Hi Ravan,
Great – will assume you saw my wp.org reply.
I’ll email you with a staging site where you can see this in vivo. The flash isn’t really noticeable to me beyond usual pageload stuff.
See what you think.