How To move WordPress shortcodes from post body to template part
Shortcodes are a very fancy feature of WordPress CMS.
They basically let the developer manage some stuff programmatically and let the blogger decide which information display and where to put it according the article body.
But sometime you need the blogger to be able to decide what kind of information display, and the developer have to put them in the right place.
For example in my case I had to show first a brief introduction text and then a list of special sales.
Here’s the code
This way I’ve also fixed some issues with wpautop: in fact sometime such method will insert an empty paragraph into the html when using shortcodes.