Tabs not showing on pages
-
Hello,
I have installed your plugin and added a tab called Grout Suggestion with a short description. But this won’t show on pages.
The page I need help with: [log in to see the link]
-
Hi @clayimports,
It looks like your theme is using a custom tab layout that doesn’t allow for additional custom tabs.
You have a few different options in these situations. The first is to contact your theme developer and ask them if they can confirm whether or not the tab template allows for custom tabs. Maybe they’re aware of the problem and have a solution.
If you’re familiar with PHP and WooCommerce templates/replacing templates, you could find the
tabs.php
template file in your theme (it should be in your theme’s folder:/woocommerce/templates/single-product/tabs/tabs.php
)If you’re not familiar with templates, you could paste the contents of your tabs template file here and we can look it over and see if it can be extended.
I like the way your tabs look and I would be more than happy to try to get our plugin working with it!
All the best,
Kevin.<?php /** * The template for displaying product content in the single-product.php template * * This template can be overridden by copying it to yourtheme/woocommerce/content-single-product.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates * @version 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } ?> <?php /** * woocommerce_before_single_product hook. * * @hooked wc_print_notices - 10 */ do_action( 'woocommerce_before_single_product' ); if ( post_password_required() ) { echo get_the_password_form(); return; } ?> <div id="product-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="woocommerce-product-header"> <?php do_action( 'woocommerce_product_header' ); ?> </div> <div class="woocommerce-product-images"> <?php /** * woocommerce_before_single_product_summary hook. * * @hooked woocommerce_show_product_sale_flash - 10 * @hooked woocommerce_show_product_images - 20 */ do_action( 'woocommerce_before_single_product_summary' ); ?> </div> <div class="summary entry-summary"> <?php /** * woocommerce_single_product_summary hook. * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_rating - 10 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked woocommerce_template_single_meta - 40 * @hooked woocommerce_template_single_sharing - 50 * @hooked WC_Structured_Data::generate_product_data() - 60 */ do_action( 'woocommerce_single_product_summary' ); ?> <div class="woocommerce-product-panels"> <?php global $post, $product; ?> <div class="woocommerce-product-panel"> <?php $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Description', 'woocommerce' ) ) ); ?> <h2 class="woocommerce-product-panel-heading"><?php echo $heading; ?><span class="heading-toggle"><span class="heading-toggle-line-1"></span><span class="heading-toggle-line-2"></span></span></h2> <div class="woocommerce-product-panel-content"><?php the_content(); ?></div> </div><!-- .woocommerce-product-panel --> <div class="woocommerce-product-panel"> <?php $heading = esc_html( apply_filters( 'woocommerce_product_additional_information_heading', __( 'Additional information', 'woocommerce' ) ) ); ?> <h2 class="woocommerce-product-panel-heading"><?php echo $heading; ?><span class="heading-toggle"><span class="heading-toggle-line-1"></span><span class="heading-toggle-line-2"></span></span></h2> <div class="woocommerce-product-panel-content"><?php do_action( 'woocommerce_product_additional_information', $product ); ?></div> </div><!-- .woocommerce-product-panel --> </div><!-- .woocommerce-product-panels --> </div><!-- .summary --> <?php /** * woocommerce_after_single_product_summary hook. * * @hooked woocommerce_output_product_data_tabs - 10 * @hooked woocommerce_upsell_display - 15 * @hooked woocommerce_output_related_products - 20 */ do_action( 'woocommerce_after_single_product_summary' ); ?> </div><!-- #product-<?php the_ID(); ?> --> <?php do_action( 'woocommerce_after_single_product' ); ?>
I am not sure if you meant this.. I wasn’t able to fin /tabs.php/ but I could go to /content-single-product php/ Please let me know if this is wrong.
- This reply was modified 5 years, 9 months ago by Jan Dembowski.
Hi @clayimports,
You found the right file. I can see the code that is creating the tabs and it is only looking for two tabs (Description and Additional Information).
I can try to customize this template so it goes through all of the custom tabs.
Could you do me a favor and edit your last post and wrap all of the code in the “
code
” tag (or use backticks like`).
Also, are you using a child theme? If we want to customize this template we’ll need to do it within a child theme (or any theme updates will overwrite our changes).
Thank you,
Kevin.Thank you for your prompt reply. I am so sorry to say this but I don’t understand your request.. I think I am using a child theme (I am so sorry but i am not sure this as well : ( .. )
like this,.?
It’s okay. Are you able to view your websites files? Do you have access to either a File Manager (via cpanel or your server’s backend) or SFTP? If we want to replace the template, we’ll need to be able to create new files.
Also, what is your current active theme? The name might give us an idea of whether it is a child theme or not.
Hello,
Yes, I have access to cpanel.
and we are using Clay Imports theme now by Mark Demoss..
Okay. Give me some time to look at the template and see how I can adjust it. I am quite busy today but I am hoping to get to this either later today or tomorrow.
Thank you so much once again. Please let me know when you are done!
Hi @clayimports,
I have a file that I think will work but I can’t test it because I am not using your theme. Do you have a staging/test site that you could test this on? Or are you comfortable with trying the file on your live site and reverting it if it doesn’t work? (Make sure to save your current file on your computer so it’s easy to revert the files).
This is the updated version of the file:
<?php /** * The template for displaying product content in the single-product.php template * * This template can be overridden by copying it to yourtheme/woocommerce/content-single-product.php. * * HOWEVER, on occasion WooCommerce will need to update template files and you * (the theme developer) will need to copy the new files to your theme to * maintain compatibility. We try to do this as little as possible, but it does * happen. When this occurs the version of the template file will be bumped and * the readme will list any important changes. * * @see https://docs.woocommerce.com/document/template-structure/ * @author WooThemes * @package WooCommerce/Templates * @version 3.0.0 */ if ( ! defined( 'ABSPATH' ) ) { exit; // Exit if accessed directly } ?> <?php /** * woocommerce_before_single_product hook. * * @hooked wc_print_notices - 10 */ do_action( 'woocommerce_before_single_product' ); if ( post_password_required() ) { echo get_the_password_form(); return; } ?> <div id="product-<?php the_ID(); ?>" <?php post_class(); ?>> <div class="woocommerce-product-header"> <?php do_action( 'woocommerce_product_header' ); ?> </div> <div class="woocommerce-product-images"> <?php /** * woocommerce_before_single_product_summary hook. * * @hooked woocommerce_show_product_sale_flash - 10 * @hooked woocommerce_show_product_images - 20 */ do_action( 'woocommerce_before_single_product_summary' ); ?> </div> <div class="summary entry-summary"> <?php /** * woocommerce_single_product_summary hook. * * @hooked woocommerce_template_single_title - 5 * @hooked woocommerce_template_single_rating - 10 * @hooked woocommerce_template_single_price - 10 * @hooked woocommerce_template_single_excerpt - 20 * @hooked woocommerce_template_single_add_to_cart - 30 * @hooked woocommerce_template_single_meta - 40 * @hooked woocommerce_template_single_sharing - 50 * @hooked WC_Structured_Data::generate_product_data() - 60 */ do_action( 'woocommerce_single_product_summary' ); ?> <div class="woocommerce-product-panels"> <?php global $post, $product; ?> <div class="woocommerce-product-panel"> <?php $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Description', 'woocommerce' ) ) ); ?> <h2 class="woocommerce-product-panel-heading"><?php echo $heading; ?><span class="heading-toggle"><span class="heading-toggle-line-1"></span><span class="heading-toggle-line-2"></span></span></h2> <div class="woocommerce-product-panel-content"><?php the_content(); ?></div> </div><!-- .woocommerce-product-panel --> <div class="woocommerce-product-panel"> <?php $heading = esc_html( apply_filters( 'woocommerce_product_additional_information_heading', __( 'Additional information', 'woocommerce' ) ) ); ?> <h2 class="woocommerce-product-panel-heading"><?php echo $heading; ?><span class="heading-toggle"><span class="heading-toggle-line-1"></span><span class="heading-toggle-line-2"></span></span></h2> <div class="woocommerce-product-panel-content"><?php do_action( 'woocommerce_product_additional_information', $product ); ?></div> </div><!-- .woocommerce-product-panel --> <?php /** * Filter tabs and allow third parties to add their own. * * Each tab is an array containing title, callback and priority. * @see woocommerce_default_product_tabs() */ $tabs = apply_filters( 'woocommerce_product_tabs', array() ); if ( ! empty( $tabs ) ) : ?> <?php foreach ( $tabs as $key => $tab ) : ?> <?php if ( $key === 'additional_information' || $key === 'reviews' || $key === 'description' ) { continue; } ?> <div class="woocommerce-product-panel"> <h2 class="woocommerce-product-panel-heading"><?php echo apply_filters( 'woocommerce_product_' . $key . '_tab_title', esc_html( $tab['title'] ), $key ); ?><span class="heading-toggle"><span class="heading-toggle-line-1"></span><span class="heading-toggle-line-2"></span></span></h2> <div class="woocommerce-product-panel-content"><?php if ( isset( $tab['callback'] ) ) { call_user_func( $tab['callback'], $key, $tab ); } ?></div> </div> <?php endforeach; ?> <?php endif; ?> </div><!-- .woocommerce-product-panels --> </div><!-- .summary --> <?php /** * woocommerce_after_single_product_summary hook. * * @hooked woocommerce_output_product_data_tabs - 10 * @hooked woocommerce_upsell_display - 15 * @hooked woocommerce_output_related_products - 20 */ do_action( 'woocommerce_after_single_product_summary' ); ?> </div><!-- #product-<?php the_ID(); ?> --> <?php do_action( 'woocommerce_after_single_product' ); ?>
I tried the file on my website and it says the code snippet you are trying to save produced a fatal error online 29:
If you are okay, could you please take a look once again? Or I can give you our website credentials so you can make a change if this is way easier?
Thank you for your help once again..
Hi @clayimports,
I didn’t change anything above line 90 so I am not sure what happened there. Feel free to email us at plugins [at] yikesinc [dot] com and we can discuss more advanced troubleshooting techniques.
Thank you,
Kevin.Hi, @yikesitskevin I seem to be having the same problem… I have informed the developers of Generate Press, I am waiting for their feedback.
Hi @leighhawthorn,
I am not seeing any of WooCommerce’s default tabs on your product page. Does your product have a description? Are reviews enabled? If these tabs aren’t displaying it means your theme has removed the tabs action/template from the single product page.
Let me know what Generate Press says.
Cheers,
Kevin.Hi, @yikesitskevin,
Reviews are enabled, I also noticed that the default tabs and long description is not showing… I will let you know what Generate Press says as soon as I hear back from them.
Thank you for your reply ??
- The topic ‘Tabs not showing on pages’ is closed to new replies.