I'm starting to work on creating a WordPress shortcode and am having difficulty understanding how to display the output specifically using 'Return', the code I have is
if (!function_exists('kfl')) {
function kfl( $atts, $content = null ) {
extract(shortcode_atts(array(
'title' => 'Title goes here',
), $atts));
return "<div class=\"container panel\">";
return "<h3 class=\"kfl title\">".$title."</h3>";
return "</div>";
}
add_shortcode('kfl', 'kfl');
}
?>
When I use this nothing is displayed, if I remove the second Return line and add the .$title to the first line I get the container panel and unstyled title. If I replace the Returns with Echo it all works fine, but I assume there must be a reason why 'return' must is used (in most tuts).
Any advice or guidance would be most appreciated.
Thanks
return.