Title: First active tab
Last modified: March 1, 2018

---

# First active tab

 *  Resolved [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/)
 * I reordered the “customer photos” tab in first position. But the div with the
   photos is hidden by default
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffirst-active-tab%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 36 total)

1 [2](https://wordpress.org/support/topic/first-active-tab/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/first-active-tab/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/first-active-tab/page/2/?output_format=md)

 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029618)
 * Hi [@well33t](https://wordpress.org/support/users/well33t/),
 * It looks like your theme has a custom tabs layout. Do you know if you have any
   options to always show the first tab by default?
 * If not, we can definitely add some JavaScript that will control this (i.e. `jQuery('.
   customer-photos_tab > a' ).click();`).
 * Let me know if you’d like help adding the custom JS to your site.
 * Cheers,
    Kevin.
 *  Thread Starter [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029630)
 * I’m not aware if there’s an option to show the first tab by default. Where do
   you want me to add the JS ?
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029650)
 * The best way to add the JS is through creating a JavaScript file and enqueue’ing
   only on single product pages. However, this is a complicated process if you’re
   not familiar with it. The alternative is to use a filter function, which I will
   provide for you.
 * Are you familiar with filter functions?
 * You should add this code to your child theme’s functions.php file. If you’re 
   not using a child theme, you can add it to your theme’s functions.php file. If
   you’d rather not touch your theme, you can use a plugin like My Custom Functions(
   [https://wordpress.org/plugins/my-custom-functions/](https://wordpress.org/plugins/my-custom-functions/)).
 * This is the code:
 *     ```
       add_action( 'wp_footer', 'yikes_expand_first_tab' );
   
       function yikes_expand_first_tab() {
       	if ( ! is_product() ) {
       		return;
       	}
       	?>
       	<script type="text/javascript">
       		jQuery( document ).ready( function() {
       			jQuery( '.customer-photos_tab > a' ).click();
       		});
       	</script>
       	<?php
       }
       ```
   
 * Note: a couple of weeks ago someone reported the same issue. The original code
   we tried didn’t work and we had to use a second approach so don’t get discouraged
   if it doesn’t immediately work!
 * Cheers,
    Kevin.
 *  Thread Starter [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029667)
 * I have updated the functions.php file and it doesnt seem to be working.
 * [https://staging4.crowneyelashes.com/product/picture-perfect/](https://staging4.crowneyelashes.com/product/picture-perfect/)
 * P.s. Thanks for the quick help very appreciated
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029722)
 * Agh, it looks like a timing issue (for some reason, something in your theme is
   hiding the content after we’re trying to show it).
 * To resolve this, we have two different approaches. I am going to copy and paste
   the entire snippet so make sure to delete what you currently have before trying
   either of these approaches. Also, make sure to only try one approach at a time.
 * Approach #1 – bump the priority.
 *     ```
       add_action( 'wp_footer', 'yikes_expand_first_tab', 1000 );
   
       function yikes_expand_first_tab() {
       	if ( ! is_product() ) {
       		return;
       	}
       	?>
       	<script type="text/javascript">
       		jQuery( document ).ready( function() {
       			jQuery( '.customer-photos_tab > a' ).click();
       		});
       	</script>
       	<?php
       }
       ```
   
 * Approach #2 – use a timeout.
 *     ```
       add_action( 'wp_footer', 'yikes_expand_first_tab', 1000 );
   
       function yikes_expand_first_tab() {
       	if ( ! is_product() ) {
       		return;
       	}
       	?>
       	<script type="text/javascript">
       		jQuery( document ).ready( function() {
       			setTimeout( function(){
       				jQuery( '.customer-photos_tab > a' ).click();	
       			}, 2000 );
   
       		});
       	</script>
       	<?php
       }
       ```
   
 * You see that `2000` in the second approach? If it doesn’t work, try changing 
   that to 3000, 4000, etc. If it does work, try changing that to 500, 1000, 1500.
 * What it’s doing is waiting 2 seconds (2000 milliseconds) after the page loads
   to open the tab. We’d like to reduce this time to as short as possible while 
   still maintaining the functionality.
 * Let me know how that goes.
 * Cheers,
    Kevin.
 *  Thread Starter [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029732)
 * sick its working now, can you confirm on your side ?
 * I’e used the first approach.
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029751)
 * It’s working for me. Awesome. The first approach is the better one anyway. All
   the best.
 *  Thread Starter [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029756)
 * I have another request not related to this plugin. Can we communicate by email
   or somewhere else ?
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029778)
 * Unfortunately I can’t help you with issues not related to the plugin; I’m really
   sorry about that!
 *  Thread Starter [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029783)
 * no worries, I was wondering if you guys offer custom development services !
 * Thanks again
 * Seb
 *  Plugin Contributor [Tracy Levesque](https://wordpress.org/support/users/liljimmi/)
 * (@liljimmi)
 * 🏳️‍🌈 YIKES, Inc. Co-Owner
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10029787)
 * Hi [@well33t](https://wordpress.org/support/users/well33t/)
 * You can learn about our agency at [https://www.yikesinc.com/](https://www.yikesinc.com/)
 * Thank you,
    -Tracy
 *  [jolie102003](https://wordpress.org/support/users/jolie102003/)
 * (@jolie102003)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10048663)
 * Hi
 * I have question how to change the default tab title, which shows in contant. 
   I would like to change translation of it or hide it only in default tab.
 * Best Regards
    Ania
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10048735)
 * Hi Ania,
 * Are you trying to get rid of this tab title? [https://yikesplugins.com/wp-content/uploads/2017/10/tab-title.png](https://yikesplugins.com/wp-content/uploads/2017/10/tab-title.png)
 * If so, you can do this with a filter function like this:
 *     ```
       /**** YIKES Custom Product Tabs - Remove Tab Title ****/
       add_filter( 'yikes_woocommerce_custom_repeatable_product_tabs_heading', '__return_false' );
       ```
   
 * Are you familiar with adding filter functions?
 * Let me know.
 * Cheers,
    Kevin.
 *  Thread Starter [well33t](https://wordpress.org/support/users/well33t/)
 * (@well33t)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10048760)
 * Hi Kevin,
 * I’ve just realized that the trick we did to display the customer photo tabs worked
   only on desktop. It doesnt on mobile
    -  This reply was modified 8 years, 3 months ago by [well33t](https://wordpress.org/support/users/well33t/).
 *  Plugin Contributor [yikesitskevin](https://wordpress.org/support/users/yikesitskevin/)
 * (@yikesitskevin)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/#post-10048873)
 * Hi @welll33t,
 * Hmm. I’m having a hard time getting it to work on mobile (it’s not the easiest
   thing to test either).
 * Try this:
 *     ```
       add_action( 'wp_footer', 'yikes_expand_first_tab', 1000 );
   
       function yikes_expand_first_tab() {
       	if ( ! is_product() ) {
       		return;
       	}
       	?>
       	<script type="text/javascript">
       		jQuery( document ).ready( function() {
       			jQuery( '.customer-photos_tab > a' ).click();
                               jQuery( '.lt-tabs li a' ).touchstart( function(){ jQuery( this ).trigger( 'click' ) });
       		});
       	</script>
       	<?php
       }
       ```
   

Viewing 15 replies - 1 through 15 (of 36 total)

1 [2](https://wordpress.org/support/topic/first-active-tab/page/2/?output_format=md)
[3](https://wordpress.org/support/topic/first-active-tab/page/3/?output_format=md)
[→](https://wordpress.org/support/topic/first-active-tab/page/2/?output_format=md)

The topic ‘First active tab’ is closed to new replies.

 * ![](https://ps.w.org/yikes-inc-easy-custom-woocommerce-product-tabs/assets/icon-
   256x256.png?rev=1558461)
 * [Custom Product Tabs for WooCommerce](https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/yikes-inc-easy-custom-woocommerce-product-tabs/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/)
 * [Active Topics](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/yikes-inc-easy-custom-woocommerce-product-tabs/reviews/)

 * 36 replies
 * 4 participants
 * Last reply from: [well33t](https://wordpress.org/support/users/well33t/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/first-active-tab/page/3/#post-10049505)
 * Status: resolved