Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
  • #1320865


    we are using the tab section on our website. Unfortunately, there was no option to initially have all tabs closed.

    I researched in the forum and found one thread that deals with this subject.

    The suggestion was to edit the tab.php in /wp-content/themes/enfold/config-templatebuilder/avia-shortcodes/tabs and set the “$inital = 1;” to “= 0;”.

    So I created a “shortcodes” file in my child theme and added this to my functions.php:

    add_filter('avia_load_shortcodes', 'avia_include_shortcode_template', 15, 1);
    function avia_include_shortcode_template($paths)
      $template_url = get_stylesheet_directory();
          array_unshift($paths, $template_url.'/shortcodes/');
      return $paths;

    But it didn’t work out. How can I close all Tabs.

    Thanks in advance.

    Kind regards


    Hey emilconsor,

    Thank you for the inquiry.

    You will have to directly modify the enfold/config-templatebuilder/avia-shortcodes/tab_section/tab_section.php file. Look for this code around line 567.

    				 * Bugfix: Set no-scroll to avoid auto smooth scroll when initialising tab section and multiple tab sections are on a page - removed in js.
    				$active_tab = $i == $atts['initial'] ? 'av-active-tab-title no-scroll' : '';

    Above it, add this code to set the initial tab to zero.

    $atts['initial'] = 0;

    Best regards,


    Hey Ismael,

    thank you, the code worked. But It’s not quite what I expected.

    The tabs are closed, but it’s just a whitespace. I created Screenshots for better understanding.

    How it is:
    How it should be:

    I need the tabs fully removed until the user clicks it.

    Hope that clarifies my problem.

    Best regards,


    Thank you for your patience, I tested this by editing the file \wp-content\themes\enfold\config-templatebuilder\avia-shortcodes\tab_section\tab_section.php lines 568-569 as above:

    $atts['initial'] = 0;
    	$active_tab = $i == $atts['initial'] ? 'av-active-tab-title no-scroll' : '';

    on our demo and found that the tab section inner container shows as an empty section because the content is in the div just off the screen, so I wrote a script that changes the display of the inner container to none if no tab titles have the active class. Try adding this code to the end of your functions.php file in Appearance ▸ Editor:

    function custom_check_for_active_tab_title() { ?>
        if ($('#plugins .av-tab-section-tab-title-container').children('a[aria-controls^="av-tab-section"].av-active-tab-title').length === 0) {
        	$('#plugins .av-tab-section-inner-container').css({"display": "none"});
    	 $('#plugins a[aria-controls^="av-tab-section"]').on('click', function() {
    	 	if ($('#plugins .av-tab-section-tab-title-container').children('a[aria-controls^="av-tab-section"].av-active-tab-title').length > 0) {
        	$('#plugins .av-tab-section-inner-container').css({"display": "block"});
    add_action('wp_footer', 'custom_check_for_active_tab_title');

    You will note in the script I used the ID #plugins, this was the ID of the section I tested on, you can remove it, but I recommend changing it to an ID you will use for this section on your site so the script doesn’t affect other sections.
    You will also note that I had to use a setTimeout because the class is added after the DOM so we have wait a little bit. 300ms.

    Best regards,

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.