-
AuthorPosts
-
December 7, 2022 at 9:14 pm #1375440
Hi
I had this thread open: https://kriesi.at/support/topic/show-product-category-description-even-when-there-is-no-products/#post-1358508
I have the solution of the above thread working, however, because the search results uses a page template, the H1 in the description editor gets converted to uppercase. All other product categories use the shop template and the H1 is in normal sentence case.How to I maintain consistency by having the H1 display in sentence case on the search result page?
Here’s the code snippet I have and would it be appropriate to add CSS for the H1 within it?
function archive_description_callback() { $term_object = get_queried_object(); $archive_description = $term_object->description; echo '<div class="archive-description">'.$archive_description.'</div>'; return $output; } add_shortcode( 'archive_description_shortcode', 'archive_description_callback' ); function add_archive_description_shortcode() { ?> <script> (function($){ var short_code = '<?php echo do_shortcode("[archive_description_shortcode]"); ?>'; if ($('#top.archive.tax-product_cat .entry-content-wrapper').attr("id") == "search-fail") { $(short_code).insertBefore( ".woocommerce-products-header" ); } })(jQuery); </script> <?php } add_action('wp_footer', 'add_archive_description_shortcode');Thank you
LyseDecember 7, 2022 at 9:32 pm #1375444Hi
Here’s a links to a product category that does not have products and where the H1 is in uppercase: https://diyjewellery.com/settings/settings-jeweler/settings-jeweler-gold/Thanks
LyseDecember 10, 2022 at 10:48 pm #1375792Hi,
Thanks for the link to your page, please try this css:#top.archive .template-search-none.template-page .entry-content-wrapper h1 { text-transform: capitalize; }After applying the css, please clear your browser cache and check.
Best regards,
MikeDecember 10, 2022 at 11:32 pm #1375795Hi Mike,
Thank you so much. That CSS does the trick.
Have a nice remaining of your weekend.
Happy Holidays
LyseDecember 10, 2022 at 11:56 pm #1375799Hi,
Glad we were able to help, if you have any further questions please create a new thread and we will gladly try to help you. Thank you for using Enfold.Best regards,
Mike -
AuthorPosts
- The topic ‘H1 whithin the product category description converted to uppercase’ is closed to new replies.
