Site logo

Archived topic

Hooks coding for placing elementor

3 replies · Started by Mikel Mandon on October 24, 2017

Viewing posts 1–4 of 4

Hi GP Team

I am interested if possible to manage a few php codes to use in hooks ( I have browsed the forum support though haven't found anything similar)

Example 1
How to add an elementor template in all pages except shop

Example 2
A variant of the above excluding some product_cat or product_ID

Example 3
Adding an elementor templates in some of the category pages filtering by product_cat and or by ID

PS: I suggest to create a big topic compiling all these hooks for easy access

Thanks very much

Hi there,

1.

<?php if ( ! is_shop() ) { 
    echo do_shortcode("[elementor-template id='16040']");
} ?>

2.

<?php if ( ! is_product_category() ) { 
    echo do_shortcode("[elementor-template id='16040']");
} ?>

3.

<?php if ( is_product_category( 'shirts' ) ) { 
    echo do_shortcode("[elementor-template id='16040']");
} ?>

In php, ! means does not equal to. && can be used for multiple conditions.

I don't think it's possible to compile all conditions as there are simply too many.
You can see WooCommerce list here: https://docs.woocommerce.com/wc-apidocs/package-WooCommerce.Functions.html

Hi Leo,

Thank you very much !

Mikel

No problem!

This archived topic is closed to new replies.