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;
}
Related Posts:
- Get name of the current template file
- How do you find out which template page is serving the current page?
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- How do you access the Product Short Description in a WooCommerce email template? [closed]
- Is there a way to list all used/unused WP templates?
- Print WordPress template filename(s) for debugging
- Change the name of the ‘Default Template’
- Echoing Elementor page content in template, but it doesn’t get styles and some widgets are missing
- How do I get the URL of a specific size featured image?
- How can I modify the default reset (lost) password email text?
- Template files missing after moving site
- Create Page that uses specific template
- Sharing templates with the JSON API?
- Prevent private post 404
- Grid layout “last” class to every third item
- How do you modify Page Template?
- Using “setup_postdata” with “get_template_part” does not work
- How can I get the content of the home page?
- Why aren’t my posts showing?
- How to display error on specific template?
- How to move style from template file to section?
- What is content.php file that is needed for Jetpack infinite scroll plugin?
- Auto-Generate Longtail-SEO Pages/URLs
- ACF image field to WordPress featured image
- Child theme template file will not load
- bloginfo(‘template_directory’) img src
- Should template files be copied to the child theme for editing?
- ACF – Theming Flexible Content
- Calling an image within the theme folder from inside a post/page?
- Best Constant to use to check if WordPress is running
- WordPress automatically created files like .theme-name / .plugin-name.php [closed]
- style sheet header on Page Templates
- WordPress editable template fields
- Why does the Full-width Template in Twenty Twelve pack so many classes into the body class attribute?
- How to support custom templates on a custom post type?
- How to use $wpdb (from the template) to update the DB, without being an admin
- get_file_data to read data for Custom Template File?
- Page attributes missing
- Remove Items from Template Homepage
- Bizarre issue with custom RSS template
- Using shortcode in template file
- Display current category and child
- Return get_header and get_footer string instead of echo it
- Different templates for same content, landing page from different URLs (generic, simple)
- Use one template only for custom post type archives?
- Is there a more efficient way to loop through pages?
- How to create a post template with two sidebars
- Is it possible to register a new template file?
- What template is used for viewing Media Library Files?
- != and !== both not always working? [closed]
- Page template for a site from network
- Remove portion of header code from home page only
- Use a separate template for the home page only
- Create a blank test.php
- How do I remove the word “Blog” from a WordPress Homepage?
- Prevent 404 and serve custom template for custom URL
- AMP version of front page without plugin
- use a custom page to display search results
- When a user registers, create a page from an existing template with their username as the page name
- Give wp link pages it’s own template
- How to add description over forum list on bbpress root page
- /wp-admin/post.php shows 404 template on submit
- two active templates for one post
- Where is the code for “Front Page Template”?
- Help Understanding Template Hierarchy
- Which template.php for /blog
- what is template-name.php
- templates with page teasers Or Featured Items
- If Child or Grandchild of Page
- List Category Posts plugin – underline links [closed]
- Conditional template tag for buddypress pages
- Need help with my template [closed]
- Is it possible to create custom links inside a template?
- WordPress Template Reverts to default template after changing
- using add_filter in a template_redirect function?
- How does post loop integrate individual page elements
- Content not showing properly with the first load of the page
- Where do I edit what the user sees on my WordPress site?
- Timber + MtHaml, or any other HAML-like HTML shorthand
- User role templates
- Using a SendGrid transactional template with wp_mail
- Language file doesn’t work (poeedit)
- How to adjust only the template gallery
- Archive only for /year/month, not terms
- Nested Page Template not showing in page attributes
- Header and footer fail to load with SSL and custom links
- How can I add some blocks to template without changing template file?
- Creating page-templates directory breaks everything!
- Editing the tag pages and using templates
- Problem displaying replies as part of author’s latest comments on author page
- custom template – override plugin template in child theme – issue with scripts
- Is it better practice to create many page templates, or a a few base templates with custom HTML added via TinyMCE?
- Add pagination to blog
- Styling own template
- Choose to show or not show title on a template?
- changes to templates not showing on server
- Add multiple pages to theme customizer
- Single Post Template with Dropdown Option?
- Problem with permalink structure for WordPress custom post_type archive template
- Output fields manually in Woocommerce email templates