If you use locate_template()
instead of get_template_part()
you can use all variables in that script:
include(locate_template('include-modal-video.php'));
Then, <h2>00: <?php echo $video; ?></h2>
will work.
Related Posts:
- Is there any way to use get_template_part() with folders?
- get_template_part for template in subdirectory not working
- Current URL path variable
- Is it possible to override the result of get_template_part()?
- Retrieve the template directory URI via global or get_template_directory_uri() every time?
- Get template part vs locate template function
- passing argument to get_template_part() or a better way to code
- Templates & CSS – Proper Programming Practice?
- TwentyTen: Overloading template.php files vs. get_template_part
- How to include template according to meta post value
- Accessing $post variable from template part
- Using Includes in Templates in Document Head
- Adding variable to get_template_part
- How to move style from template file to section?
- Unable to include a template
- Where is the template for the ‘standard’ format of a post in the theme twentythirteen?
- Valid HTML in Template Part
- global variables in templates
- Remove portion of header code from home page only
- Use a separate template for the home page only
- How to create new template page and template-parts in wordpress theme [closed]
- Including template pages within another template?
- Why won’t the action hook wp_head accept parameters?
- Organize template parts and page templates in folders in regards of template hierarchy
- How to get all template files used for rendering a single post/page?
- Display a custom 404 page without a redirect
- How to add variables to a template
- How can I show contents of a template part inside of another page?
- Using require_once for parent-directory not working but is working in sub-directories
- When to use content-pagename.php?
- Is it possible to call a template file inside wysiwyg editor? And how?
- If I define a variable in header.php, how do I make it available to templates?
- Dynamic header and footer template inclusion: footer script not included
- How can one use variables in a template or template part without polluting the global scope?
- Adding Page Attributes Metabox and Page Templates to the Posts Edit Page?
- 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 can I modify the default reset (lost) password email text?
- How do you modify Page Template?
- Using “setup_postdata” with “get_template_part” does not work
- Template tags for Buddypress
- How to display only an excerpt of the content with custom post types?
- get_template_part returns NULL
- Display “large” image size and show caption in attachment page
- How to delete read more span on single post view?
- Conditionally display different images before the content in a page template
- Show all parts in multipage post
- One of my pages uses the archive.php template only. Why?
- Why are 404s not triggering my 404.php template?
- Result of API Request to global variable?
- Is there a way to create a block template that is not limited to a post type?
- How to modify a global variable in a function and use it on another function?
- link to non-category page routed to category template
- Can’t format content of Rich Text Editor in Template
- Footer.php not showing?
- How to publish a Page and Posts using single template
- lost css when overriding themes templates
- What is the best practice to style archive page 2,3,etc differently than archive.php?
- How to create a post template with two sidebars
- ACF costum date format [closed]
- WordPress 3.3.1 single post template
- Conditional to determine if search.php page is the current template
- Page Templates not using functions.php
- Add stylesheet per layout
- Get template part with CPT and Custom Taxonomy conditionals
- Theme settings Page: Settings Api vs Update_Options
- Page template not registering on theme
- Pass global variable from Page 1 to page 2 (Pagination)
- How do I custom a page that doesn’t exist in the page list?
- Uncaught Error: Call to undefined function twentytwenty_the_post_meta()
- small problem in the article ()
- Unable to access wordpress page
- How to access custom class methods from any include without using global
- How to configure my blog page
- BuddyPress : how can I call the template WordPress would have chosen (template hierarchy)?
- How can I make custom page templates work on child theme?
- Why default template does not show?
- Why does the blog page not take the page template selected?
- Custom Taxonomy Theme file not routing correctly
- Why would adding a template file to a child theme cause an error in template-loader.php?
- How can I make is_page_template() workable in child theme?
- Creating a popup
- WordPress not picking up custom templates in sub directory
- Editing Global Variables from Inside Functions
- Category template not displaying all post formats
- Retrieving post ID from current page
- Mysterious template change after database import/export
- Is there a way to share a template/markup with the JSON API so that it doesn’t need to be declared both in PHP and in JS?
- Styling own template
- WordPress sites translate dynamically generated Homepages
- Why is this page using the homepage template and not the one it should?
- Single template will not show sidebar/bottom-nav and footer
- strange parse error when including a loop template within another template
- Make default template two columns?
- Read more button not working
- How to limit block activity (insertion/deletion) to inside of a Block Template on the Admin Screen?
- WordPress template restored by mistake
- Unload templates; disable parent Template Parts using only “theme.json”