Templates to use multiple time within page? [closed]

If you are trying to do this within a page or post, you could make a shortcode out of it.


[movie-template title="Gone With the Wind" date="1939" image="gwtw.jpg"]
[movie-template title="Citizen Kane" date="1941" image="ck.jpg"]
[movie-template title="Star Wars" date="1977" image="sw.jpg"]

Then you need a little code, in your template’s functions.php, or in a custom plugin:


add_shortcode( 'movie-template', 'my_movie_listings' );
function my_movie_listings( $atts ) {
$atts = shortcode_atts(
array(
'foo_title' => 'title',
'foo_date' => 'date',
'foo_image' => 'image',
), $atts );
// $atts['foo_title'] is your movie title
// $atts['foo_date'] is your movie date
// $atts['foo_image'] is your movie image
$ret = "do something here with {$atts['foo_title']}";
return $ret;
}