• Resolved codedrobot

    (@codedrobot)


    When I click a FAQ, it looks like it starts to expand, but then actually opens the permalink page. Is there a hidden setting to make it not actually redirect to the permalink?

    I have FAQ Toggle set to on. This happens both with the current search + display shortlink I’m using, plus the normal ultimate-faqs shortlink

    I’ve also tried all the different toggles for both “Include Permalink” and “Permalink Destination” settings, and every different combination results in the same behavior.

    Thanks.

    The page I need help with: [log in to see the link]

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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.

    Thread Starter codedrobot

    (@codedrobot)

    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.

    Thank you!

    Thread Starter codedrobot

    (@codedrobot)

    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.

    Thread Starter codedrobot

    (@codedrobot)

    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)

    Thread Starter codedrobot

    (@codedrobot)

    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. https://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 5 years, 11 months ago by msamerson.
Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘Expanding FAQs always opening new page’ is closed to new replies.