Home Forums WoodMart support forum PHP code to modify H4 of size chart title by (on product pages)

PHP code to modify H4 of size chart title by (on product pages)

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #516091

    ecom.france35
    Participant

    Hello,

    I need to change H4 of size chart title by <p> (on product pages) for my SEO.

    Not CSS because tag will stay H4 so need PHP code.

    Thank you.

    #516286

    Luke Nielsen
    Keymaster

    Hello,

    Copy this inc/integrations/woocommerce/modules/size-guide.php file with the path to the child theme and replace the tag on the 209 line: https://take.ms/uwSGD

    Kind Regards

    #516289

    ecom.france35
    Participant

    Thank you so much

    #516300

    ecom.france35
    Participant

    I did it as you can see on screenshots, but it doesn’t work…

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

    Luke Nielsen
    Keymaster

    Hello,

    In this case, remove the copy of that file mentioned above, and paste 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
    }

    Kind Regards

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