• Resolved fmortara

    (@fmortara)


    Hi to all!

    I’ve tried to add a shortcode immediately before woocommerce breadcrumbs.

    So I added in my theme this code:

    add_action( 'woocommerce_before_main_content', 'mostra_slider', 10, 0 );
    
    if ( ! function_exists( 'mostra_slider' ) ) {
    
    function mostra_slider() {
        //echo "SLIDER";
        echo do_shortcode('[rev_slider alias="slider-200px"][/rev_slider]');
        //add_revslider('slider-200px'); // this code alternatively but same results
    }
    }

    The slider are printed as last element of block, just before the content, no matter what priority I use. I’ve tried also with strefront theme.

    How can I fix this issue?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi there @fmortara ??

    Helping out with custom coding of this nature is outside the scope of support that our support staff can help out with here, although I would recommend the following:

    • Joining our WooCommerce Slack community (it does have a developer channel where you can ask coding questions): https://woo.com/community-slack/
    • Running the exact question you’re asking, along with the code provided, through an AI platform like ChatGPT for recommendations/changes to your code;

    I hope this is helpful! Please let us know if you have any further questions about this matter, or if we misinterpret your concern in any way. We will be happy to help you further.

    We haven’t heard back from you in a while, so I’m going to mark this as resolved – we’ll be here if and/or when you are ready to continue.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Action woocommerce_before_main_content not works properly’ is closed to new replies.