0

I looked at some code for an article and saw that there was a shortcode contained in a <p> tag:

<p>Blabla</p>
<p>[shortcode]</p>
<p>Wofwof</p>

The shortcode doesn't seem to work. Could it have anything to do with that it's contained in the paragraph tag?

1

No. Wrapping a tag around a shortcode won't prevent the function from executing.

1

In your page template, you may have to call do_shortcode() on the_content() inside your loop:

<div class"your-content>
    <?php do_shortcode( the_content() ); ?>
</div>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.