Home Forums WoodMart support forum h4 tag problem for size guide title in popup

h4 tag problem for size guide title in popup

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #540919

    Jean Bon
    Participant

    Hello,

    The html tag used in the size guide popup for the title is the h4 tag. This poses a problem for optimizing the html structure for SEO. The page must follow a tree structure of nested tags: h1 contains H2 which contains h3 which contains h4.

    Putting an h4 tag in the size guide popup breaks the proper structure of the page, and is bad for SEO.

    What’s more, it’s not possible to make an override, as the h4 tag isn’t displayed via a template but in a php file.

    Can you change the h4 title tag to div or something different from hx?

    thanks in advance

    Attachments:
    You must be logged in to view attached files.
    #540989

    Hello,

    Try to add the below function to the functions.php file in your child theme.

    function woodmart_sguide_display_table_template( $sguide_post, $size_tables, $args = array() ) {
    		$is_quick_view = woodmart_loop_prop( 'is_quick_view' );
    
    		if ( ! isset( $args['builder_classes'] ) || empty( $args['builder_classes'] ) ) {
    			$args['builder_classes'] = ' wd-style-text';
    		}
    
    		if ( ! woodmart_get_opt( 'size_guides' ) || $is_quick_view || ! $size_tables || ! $sguide_post ) {
    			return;
    		}
    
    		$show_table = get_post_meta( $sguide_post->ID, 'woodmart_sguide_hide_table' );
    		$show_table = isset( $show_table[0] ) ? $show_table[0] : 'show';
    
    		woodmart_enqueue_js_library( 'magnific' );
    		woodmart_enqueue_js_script( 'popup-element' );
    		woodmart_enqueue_inline_style( 'mfp-popup' );
    		woodmart_enqueue_inline_style( 'size-guide' );
    		?>
    			<style data-type="vc_shortcodes-custom-css">
    				<?php echo get_post_meta( $sguide_post->ID, '_wpb_shortcodes_custom_css', true ); ?>
    				<?php echo get_post_meta( $sguide_post->ID, 'woodmart_shortcodes_custom_css', true ); ?>
    			/* */
    			</style>
    			<div id="woodmart_sizeguide" class="mfp-with-anim mfp-hide wd-popup wd-sizeguide <?php echo woodmart_get_old_classes( ' woodmart-content-popup' ); ?>">
    				<p class="wd-sizeguide-title">
    					<?php echo esc_html( $sguide_post->post_title ); ?>
    				</p>
    				<div class="wd-sizeguide-content">
    					<?php echo do_shortcode( $sguide_post->post_content ); ?>
    				</div>
    				<?php if ( 'show' === $show_table ) : ?>
    					<div class="responsive-table">
    						<table class="wd-sizeguide-table">
    							<?php foreach ( $size_tables as $row ) : ?>
    								<tr>
    									<?php foreach ( $row as $col ) : ?>
    										<td>
    											<?php echo esc_html( $col ); ?>
    										</td>
    									<?php endforeach; ?>
    								</tr>
    							<?php endforeach; ?>
    						</table>
    					</div>
    				<?php endif; ?>
    			</div>
    
    			<div class="wd-sizeguide-btn wd-action-btn wd-sizeguide-icon<?php echo esc_attr( $args['builder_classes'] ); ?>">
    				<a class="wd-open-popup" rel="nofollow" href="#woodmart_sizeguide">
    					<span><?php esc_html_e( 'Size Guide', 'woodmart' ); ?></span>
    				</a>
    			</div>
    		<?php
    }

    Best Regards.

    #540995

    Jean Bon
    Participant

    Chokran Aizaz for this code. Like you can see in my profile, i manage a lot of Woodmart websites and it will be a pain to keep this consequent code up to date with future versions of Woodmart. Can you publish a patch for this problem because I think I’m not the only one concerned by this issue. And it will help all users who have the size guide enabled.

    thanks in advance

    #541004

    Hello,

    Try to use a plugin for this code.
    https://wordpress.org/plugins/code-snippets/

    Best Regards.

    #541007

    Jean Bon
    Participant

    You didn’t understand me. I use a child theme on my sites. However, each time I update Woodmart, I have to check whether this function has been modified in the core of Woodmart in order to modify the override function you posted according to the updates. This will be tedious and time-consuming. A patch to fix this permanently would be easier.

    Thanks

    #541297

    Hello,

    The patch is only available until the theme will not be updated. We do not release the patch with the theme update.

    Best Regards.

    #602622

    alphavaletec
    Participant

    We share the same problem. I believe it should be a fix in the theme and not a code to adapt.

    We also use the theme on many sites.

    An update would be appreciated!

    #602692

    Hello,

    There isn’t a quick option in the theme settings to fix this issue. You’ll need to use custom code to resolve it. Unfortunately, there’s no built-in fix available for this in the theme at the moment.

    Best Regards

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