Reputation: 31
How can use this WooCommerce shortcode in PHP:
[products columns="3" attribute="ir" terms="20" orderby="date"]
Any help on this?
Upvotes: 2
Views: 4451
Reputation: 253814
Inside any PHP code, use dedicated WordPress function do_shortcode()
as follow:
echo do_shortcode("[products columns='3' attribute='ir' terms='20' orderby='date']");
or inserting that on the html code from a php file:
<?php echo do_shortcode("[products columns='3' attribute='ir' terms='20' orderby='date']"); ?>
It will work on your php code.
Upvotes: 3