[Resolved] Hooks coding for placing elementor

Home Forums Support [Resolved] Hooks coding for placing elementor

Home Forums Support Hooks coding for placing elementor

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #409429
    Mikel Mandon

    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

    #409582
    Leo
    Staff
    Customer Support

    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

    #410093
    Mikel Mandon

    Hi Leo,

    Thank you very much !

    Mikel

    #410247
    Leo
    Staff
    Customer Support

    No problem!

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.