So I have a super simple Woocommerce shortcode [product_categories], It's supposed to show product categories from the shop.
It does this job perfectly if I put it inside the contents of a page as such: [product_categories].
However, if I put the same thing into the template directly it suddenly returns the first post of current category? What?!
So in my template I have only these two rows:
<?php echo do_shortcode('[product categories]'); // this returns a single product which is wrong and totally weird ?> <?php the_content(); // this returns the categories as intended ?>
I never knew these two methods have some kind of difference. How can I make the shortcode work with the echo way?