Viewing 10 replies - 1 through 10 (of 10 total)
  • At:
    wp-content/plugins/woocommerce/templates/single-product/tabs/description.php
    your customised template goes in:
    wp-content/themes/your-theme-name/woocommerce/single-product/tabs/description.php

    Or, it may be easier to add a custom style:

    #tab-description h2 {font-size:28px}

    Thread Starter tonnick0033

    (@tonnick0033)

    I would like to replace the h2 by a h3 as reviews makes no sense in h2 position from a SEO perspective.

    but my description.php file does not content anything about it :

    if ( ! defined( 'ABSPATH' ) ) {
    	exit; // Exit if accessed directly
    }
    
    global $post;
    
    $heading = esc_html( apply_filters( 'woocommerce_product_description_heading', __( 'Product Description', 'woocommerce' ) ) );
    
    ?>
    
    <?php the_content(); ?>

    Mine is similar but has these lines above your last line:

    <?php if ( $heading ): ?>
      <h2><?php echo $heading; ?></h2>
    <?php endif; ?>

    I am using WooCommerce 2.4.10.

    Thread Starter tonnick0033

    (@tonnick0033)

    yes you’re right, I added it, but it does not change anything ??

    even if I change h2 to h3, I still have in product page :

    <div id="comments">
    		<h2>Reviews</h2>
    
    			<p class="woocommerce-noreviews">There are no reviews yet.</p>
    
    			</div>

    I don’t understand why you should have to add it, do you have 2.4.10?

    Thread Starter tonnick0033

    (@tonnick0033)

    yes sorry, it was present on woocommerce original file, but not on my template one. So I added the lines you mentionned in my template file. but anyway, it does not change anything.

    Can we be sure your template is being read. What if you add say ‘print “Here”;’ does it show?

    I altered h3 to h2 and it was reflected on my page. So in your theme, something else must be printing the headings. Maybe in tabs.php?

    Thread Starter tonnick0033

    (@tonnick0033)

    ok the description.php is only for “description” tab. this is why the title has been removed from the template.

    But I want to modify the title h2 “reviews” from review tab which seems to be managed by another file as any modification I do in descrption.php is only for description tab. ?? Any idea about it ?

    wp-content/plugins/woocommerce/templates/single-product-reviews.php
    lines 22 & 27.

    Thread Starter tonnick0033

    (@tonnick0033)

    o great ! I added this file in my theme and customized it ! it works !

    thx a lot for your help !

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘h2 reviews in product review tab’ is closed to new replies.