[Resolved] Remove tag H2 in footer and make a or (Merch)

Home Forums Support Remove tag H2 in footer and make a or (Merch)

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1389130
    Dmytro

    Good day! For SEO I need:
    1. in the footer of the site, remove the H2 tags and make a <span> or

    2. product name – remove the H2 tag and make the H3 tag
    Thanks in advance for your reply.
    #1389188
    David
    Staff
    Customer Support

    Hi there,

    you can change the Footer widget titles with this PHP Snippet:

    add_filter( 'generate_start_widget_title', 'widget_title_start_tag' );
    function widget_title_start_tag()
    { 
        return '<span class="widget-title">';
    }
    
    add_filter( 'generate_end_widget_title', 'widget_title_end_tag' );
    function widget_title_end_tag()
    { 
        return '</span>';
    }

    The woo titles HTML are controlled by Woocommerce but you can try this snippet:

    remove_action( 'woocommerce_shop_loop_item_title','woocommerce_template_loop_product_title', 10 );
    add_action('woocommerce_shop_loop_item_title', 'db_woo_shop_loop_title_h3', 10 );
    function db_woo_shop_loop_title_h3() {
        echo '<h3 class="' . esc_attr( apply_filters( 'woocommerce_product_loop_title_classes', 'woocommerce-loop-product__title' ) ) . '">' . get_the_title() . '</h3>';
    }
    #1389213
    Dmytro

    where to register these codes?

    #1389222
    David
    Staff
    Customer Support
    #1389827
    Dmytro

    Thank you!

    #1390111
    David
    Staff
    Customer Support
Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.