Not apply functions.php changes to a specific element
-
Hi,
I am working with Woocommerce and Flatsome Theme.
I recently added this code to my functions.php file, in order to have H2 tags on my products titles in category pages :
function woocommerce_template_loop_product_title() { echo '<h2 class="h4"><a href="'.get_the_permalink().'">' . get_the_title() . '</a></h2>'; }
However, I use the same function to display products in my mega menu, and I don’t want them to have h2 tags.
Thus I would like to exclude those specific products on the previous code. They are defined by a CSS ID when they are in the menu. But I don’t know how to say “apply this change to everything except those elements” in PHP.
I really need your help.
Thanks in advance.
Julien
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Not apply functions.php changes to a specific element’ is closed to new replies.