Support » Plugin: Quick and Easy FAQs » open only one answer a time

  • Resolved floridante


    I’m quite happy with the plugin, thank you!
    I’ve one request though regarding toggle mode: I’d want an open answer to close as soon as another is opened, i.e. only one answer open a time.
    Is this possible to achieve?
    Any help would be greatly appreciated!

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Saqib Sarwar



    There is no settings to change this behaviour but you can modify the JavaScript if really required. Related JavaScript resides in /wp-content/plugins/quick-and-easy-faqs/public/js/quick-and-easy-faqs-public.js


    Thanks for the fast reply. I’ll have a look at the JavaScript or search for an accordion plugin.


    To use the code given at nilesh6018, replace siskoto’s code for /** * FAQs Toggles */ in your file

    but add the missing
    at the end.

    Hi Abrunger,

    I’ve tried replacing the JS as per your post and adding the additonal }); but I still get the same behaviour as before.

    Anything else I can try?

    Thanks in advance

    The file may have been overwritten in a recent update.
    At the moment, the following works for me, as the entire contents of

    (function( $ ) {
    	'use strict';
         * FAQ's setup
         * Remove .nojs from .qe-faq-toggle elements, and collapse all expanded
         * elements
        $(function() {
    	var all_toggles = $('.qe-faq-toggle');
    	all_toggles.removeClass( 'nojs active' );
    	all_toggles.find('i.fa').removeClass( 'fa-minus-circle' ).addClass( 'fa-plus-circle' );
         * FAQs Toggles
        $(function() {
    		$(".qe-toggle-title").click(function () {
    			if ($('.qe-toggle-content').is(':visible')) {
    			  $('.qe-toggle-title').find('i.fa').removeClass( 'fa-minus-circle' ).addClass( 'fa-plus-circle' );
    			if ($(this).next(".qe-toggle-content").is(':visible')) {
    					$(this).find('i.fa').removeClass( 'fa-minus-circle' ).addClass( 'fa-plus-circle' );
    			} else {
         * FAQs Filter
        $(function() {
            $('.qe-faqs-filter').click( function ( event ) {
                var filterSelector = $(this).attr( 'data-filter' );
                var allFAQs = $( '.qe-faq-toggle' );
                if ( filterSelector == '*' ) {
                } else {
                    allFAQs.not( filterSelector ).hide().end().filter( filterSelector ).show();
    })( jQuery );
    • This reply was modified 10 months, 1 week ago by  abrunger.

    There’s a slightly less messy way of doing this, if you don’t want to have to worry about updates overriding your changes.

    1) Copy the public-scripts.js file into your theme’s directory (I put it in its own my-theme/js/ directory just to keep things organized) and make the edits recommended in this thread.

    2) In your functions.php file, add the following:

    function my_enqueue_scripts() {
    	wp_enqueue_script( 'my-quick-and-easy-faqs', get_stylesheet_directory_uri() . '/js/public-scripts.js');
    	wp_dequeue_script( 'quick-and-easy-faqs' );
    add_action('wp_enqueue_scripts', 'my_enqueue_scripts');

    This tells WordPress to add your customized file and remove the one from the plugin.

    • This reply was modified 6 months, 1 week ago by  Nikki Blight. Reason: typo

    This mod, originally given at
    by nilesh6018, fails again.

    Would the author please consider adding this as a feature in the settings? Cheers.

Viewing 7 replies - 1 through 7 (of 7 total)
  • You must be logged in to reply to this topic.