I'm sure I'm missing something simple, as I rarely use shortcodes, but I can't seem to get the following shortcode to work.
I want it to be an "enclosing" short tag vs. a "self-closing", but its being treated as the latter.
[bio_image name="my name" title="my title"]
//image media in post content
[/bio_image]
with this functions.php code:
function bio_image_func( $atts, $content = null) {
extract( shortcode_atts( array(
'name' => 'employee',
'title' => 'mastermind',
), $atts ) );
return '<div class="team_photo"><p class="team_title"><span class="name">' . $name . '</span> <span class="title">' . $title . '</span></p>' . $content . '</div>';
}
add_shortcode( 'bio_image ', 'bio_image_func' );
produces:
<div class="team_photo">
<p class="team_title">
<span class="name">my name</span>
<span class="title">my title</span>
</p>
</div>
<img src="my_img_src" ... />
[/bio_image]
As you can see, the closing tag is just being printed out. Any suggestions?
for reference: the shortcode codex page