Hi @codedrobot and @msamerson
Your theme seems to be using some kind of animation/effect on page load. So, what it’s probably doing is applying that effect every time an <a> tag (link) is clicked.
Our FAQ titles are all links, but the link is bypassed when you have the toggle mode on. It seems as though the effect your theme is applying is not allowing our plugin to bypass the link for the toggle FAQs. Check to see if your theme has an option to disable this effect.
If you can’t find it, then check with the theme author to see how you can disable this effect. After that, you can test the FAQs again.
Thank you. There was a site-wide setting I was able to toggle that got it to work again.
The theme will allows for it to be disabled on a per-link basis alternatively. It does this by checking for a do-not-animate class to on link element.
Do you have a example snippet of how I would update the FAQ links that are created to include that class on each of the links it generates, as I would like to keep this feature on the rest of the pages?
Thanks.
So is there some sort of snippet I can insert to add that “do-not-animate” class to each link UFAQ is creating?
Thanks!
Hi codedrobot,
Unfortunately, we do not have any such snippet. You can make changes in the core plugin code to add “do-not-animate” class and we can tell you where to do so. We recommend making changes in the core plugin files only if you are comfortable in making changes in the code. Any changes that you make in core plugin files will be overwritten whenever you update the plugin in the future.
I’m very comfortable making changes to the code. Do you know offhand what file/function I would need to change? Thanks.
Hi @codedrobot ,
You can try adding the code in Shortcodes/DisplayFAQs.php (around line 373)
Thanks – I was able to achieve this using a filter, so by adding it to my functions.php, should persist across plugin updates. Posting it here in case anyone needs to accomplish something similar
function update_ufaq_class( $output, $tag ) {
if ( 'ultimate-faq-search' !== $tag && 'ultimate-faqs' !== $tag) {
return $output;
} else {
$output = str_replace("class='ufaq-faq-header-link'", "class='ufaq-faq-header-link do-not-animate'", $output);
$output = str_replace("class='ewd-ufaq-post-margin'", "class='ewd-ufaq-post-margin do-not-animate'", $output);
return $output;
}
}
add_filter('do_shortcode_tag', 'update_ufaq_class', 10, 2);
I found this in themeforest discussion:
The AJAX is used for all the links except the ones that have those strings inside:
[‘.pdf’,’.doc’,’.eps’,’.png’,’.zip’,’admin’,’wp-‘,’wp-admin’,’feed’,’#’, ‘?lang=’, ‘&lang=’, ‘&add-to-cart=’, ‘?add-to-cart=’, ‘?remove_item’, ‘download_file=’]
So – if you include for example, ”#” symbol at the end of the link, it will work without AJAX (eg. http://yoursite.com/page#)
I hope this trick will help you achieve the desired effect.
It worked for me when Ajax animations enabled.
In my case: https://marcossamerson.com/faq#/
-
This reply was modified 7 years, 1 month ago by
msamerson.