I'm writing a plugin that creates shortcodes. Even though the shortcodes parse as they should, I have a problem when using multiple shortcodes on the same page. So, if I do it like this in post editor:
[foobar]
<p>Lorem ipsum text</p>
[foobar]
<p>Some other text</p>
[foobar]
the HTML output is:
<div class="foobar">Foobar</div>
<div class="foobar">Foobar</div>
<div class="foobar">Foobar</div>
<p>Lorem ipsum text</p>
<p>Some other text</p>
So, it places all the shortcodes one after another, and then displays the rest of the text on page. Instead, I'd like to have that as I wrote it in post editor.
Your problem is probably that you are echo'ing the values, instead of returning them.
So, instead of doing
'echo "something" '
Do
' return "something" '
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With