I need to add a shortcode in my theme and I would like to put the HTML code not in the function which creates the shortcode but in a template file in my theme directory.
Now I have
function wpse450_show_video( $atts ) {
extract(shortcode_atts(array(
'id' => 0
), $atts ));
if( is_numeric($id) ) {
$ngvideo_title = get_the_title($id);
}
return '<div>'.$ngvideo_title.'</div>';
}
add_shortcode( 'ngvideo', 'wpse450_show_video' );
I would like to put the <div>'.$ngvideo_title.'</div>
stuff in an external file.
How to do this?