Right now I'm creating shortcodes like this:
function short_code($atts) {
$a = shortcode_atts( array(
'name' => ''
), $atts );
return '<div class="content">
<div class="container">
<p>' . esc_attr($a['name']) . '</p>
</div>
</div>';
}
add_shortcode( 'short-code', 'short_code' );
// Usage: [short-code name="John"]
How to do it so I can have incremental shortcodes? In other words, to modify the shortcode so I can do this? [short-code name="John" name="Jack" name="Mary"]
and produce something like this?
<div class="content">
<div class="container">
<p>John</p>
<p>Jack</p>
<p>Mary</p>
</div>
</div>
I searched on Google but I couldn't find anything.