{"id":541,"date":"2011-02-03T16:39:24","date_gmt":"2011-02-03T16:39:24","guid":{"rendered":"https://www.divydovy.com/?p=541"},"modified":"2020-01-23T10:30:13","modified_gmt":"2020-01-23T10:30:13","slug":"wordpress-highlight-search-terms-plugin-and-cufon-conflict","status":"publish","type":"post","link":"https://www.divydovy.com/2011/02/wordpress-highlight-search-terms-plugin-and-cufon-conflict/","title":{"rendered":"WordPress Highlight Search Terms Plugin and Cufon Conflict Fix"},"content":{"rendered":"<p>Whilst implementing Highlight Search Terms (HLST) plugin for a client&#8217;s website that also uses Cufon font replacement, I found that whenever the HLST plugin kicked in, the Cufon&#8217;d text disappeared.</p>\n<p>The symptom was that Cufon fonts flash up but it looks like they then go &#8216;invisible&#8217; when the HLST JS kicks in. I guessed that the insertion of the <code>&lt;span class=\"hilite\"&gt;</code> element breaks Cufon&#8217;s ability to manipulate the DOM (or something!)?</p>\n<p>Tried a quick fix. Whacked <code>Cufon.refresh();</code> in just before the end of the jQuery document.ready function &#8211; i.e. before the last <code>}));</code> in both compressed and uncompressed versions of the plugin&#8217;s JS file.</p>\n<p>Cross-posted from: <a href=\"http://wordpress.org/support/topic/plugin-highlight-search-terms-this-plug-in-create-problem-with-cufon-font-replacement?replies=8#post-1921792\">http://wordpress.org/support/topic/plugin-highlight-search-terms-this-plug-in-create-problem-with-cufon-font-replacement?replies=8#post-1921792</a></p>\n<p>Hope this helps someone!</p>\n","protected":false},"excerpt":{"rendered":"<p>Whilst implementing Highlight Search Terms (HLST) plugin for a client&#8217;s website that also uses Cufon font replacement, I found that whenever the HLST plugin kicked in, the Cufon&#8217;d text disappeared. The symptom was that Cufon fonts flash up but it looks like they then go &#8216;invisible&#8217; when the HLST JS kicks in. I guessed that the insertion of the &lt;span class=&#8221;hilite&#8221;&gt; element breaks Cufon&#8217;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 &#8211; i.e. before the last })); in both compressed and uncompressed versions of the [&hellip;]</p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_uag_custom_page_level_css":"","clkt_auto_upload":"0","_clkt_publish_and_upload":false,"_jetpack_memberships_contains_paid_content":false,"activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_wordproof_timestamp":false},"categories":[7],"tags":[226,142,227,228,225,62,190,224,125],"my_content_publications":[],"class_list":["post-541","type-post","status-publish","format-standard","hentry","category-web","tag-conflict","tag-cufon","tag-cufon-refresh","tag-fix","tag-font-replacement","tag-javascript","tag-jquery","tag-js","tag-wordpress"],"blocksy_meta":{"styles_descriptor":{"styles":{"desktop":"","tablet":"","mobile":""},"google_fonts":[],"version":6}},"clkt_attachments":{"featured_image":null,"inline_attachments":[],"upload_candidates":[],"max_free_size":102400,"max_allowed_size":104857600},"_clkt_upload_mode":"new_only","clkt_content_hash":"d0c11f6a09d9f0dc58a9f3889534d6cc7faae79b2a499f9e9695538f1fe409c8","customFields":{"clkt_auto_upload":"0","activitypub_content_warning":"","activitypub_content_visibility":"","activitypub_max_image_attachments":3,"activitypub_interaction_policy_quote":"","activitypub_status":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"processed_attachments":{"total_attachments":0,"uploaded_to_arweave":0,"kept_original_urls":0,"upload_summary":{"total":0,"uploaded":0,"failed":0,"too_large":0,"reused":0}}},"paymentAddress":"8_-tV4d15kVVq9Gd-Al2MAIC3LqNtJ_KgFol71TzxPw"}