Is there a way to wrap a wordpress shortcode around a div in a template file?
Here is my code:
<div id="subscription">
<?php do_shortcode('[subscribe]');?>
<p>This is subscription text</p>
</div>
I’ve also tried
<div id="subscription">
<?php do_shortcode('[subscribe]');?>
<p>This is subscription text</p>
<?php do_shortcode('[/subscribe]');?>
</div>
If by template file you mean a php file in the themes folder, you can call do_shortcode to have the shortcode processor do its magic on your div.
EDIT: not entirely sure I understand what you want, but you could try this:
I’m pretty sure the above code should be
Then you can use the content in the shortcode function like so:
The above would output: