• Resolved saulodefaria

    (@saulodefaria)


    Hey there!

    How can I add a shortcode before the page (after header and before the content)?

    If you can point me a place on the plugin code to run a “do_shortcode”, it would be awesome.

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author wpgenie2

    (@wpgenie2)

    Hi, you can use something like this

    add_action( 'woocommerce_before_shop_loop', 'custom_text_before_loop');
    
    function custom_text_before_loop(){
    	if(is_woocommerce_sale_page()){
    		echo do_shortcode( '' );
    	}
    }
    Thread Starter saulodefaria

    (@saulodefaria)

    Thanks! Butt that added the shortcode between the shop grid and the breadcrumb/sorting area. Any hook to place the shortcode before that?

    Plugin Author wpgenie2

    (@wpgenie2)

    From Woo 3.3 you can use [sale_products limit=’10’ paginate=’true’] instead of our plugin.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Add content before the page’ is closed to new replies.