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)
- This topic has 4 replies, 2 voices, and was last updated 1 year, 9 months ago by
Luke Nielsen.
Viewing 5 posts - 1 through 5 (of 5 total)
-
AuthorPosts
-
November 27, 2023 at 11:25 pm #516091
ecom.france35ParticipantHello,
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.
November 28, 2023 at 12:42 pm #516286
Luke NielsenKeymasterHello,
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/uwSGDKind Regards
November 28, 2023 at 12:45 pm #516289
ecom.france35ParticipantThank you so much
November 28, 2023 at 1:03 pm #516300
ecom.france35ParticipantI did it as you can see on screenshots, but it doesn’t work…
Attachments:
You must be logged in to view attached files.November 28, 2023 at 4:44 pm #516442
Luke NielsenKeymasterHello,
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
-
AuthorPosts
Viewing 5 posts - 1 through 5 (of 5 total)
- You must be logged in to create new topics. Login / Register