I have a php function which loops through a custom post type and outputs a number of different elements.
- an opening li tag
- an img tag
- an opening div tag
- a title
- a description
- a button
- a closing div tag
- a closing li tag
I have attached the function to a shortcode [sc_loop]. The user enters the shortcode on a page and the loop in my function gets executed and outputs the elements without any problems.
However, I want the user to be able to format elements 4,5 and 6 individually (for example font size, color, bold, underline etc.) using the tinyMCE rich text editor.
My first thought was to assign each element it's own shortcode ([sc_title], [sc_description], [sc_button]), each outputting the relevant information from my CPT loop.
But how do I get the individual shortcodes to fire within my [sc_loop] shortcode whilst still enabling the user to format each shortcode individually?
Thanks in advance for any help!