when you use get_template_part, your file navigation.php cannot access variable $navigation_type. but when you do include and locate_template it is simply like including a php file so it can access that variable.
It is due to scope of variable in your context.
Related Posts:
- Passing variables through locate_template
- How to use get_template_part()?
- Is there a variable for a template parts name?
- How to make get_template_part always check child theme first?
- Check if partial file is called from within header.php or footer.php
- Too many get_template_parts?
- get_template_part() does not work if you call it when you are in a subfolder
- Pass a variable to get_template_part
- get_template_part inside get_template_part?
- Getting the chosen template when iterating through pages
- Possible to use pagename inside get_template_part?
- How does get_template_part() work inside a loop?
- Is there a tirck in the get_xxxx function in the general_template.php file?
- Problem with using get_template_part() in footer
- how to remove get_template_part from a plugin? [closed]
- get_template_part() based on get_post_type() for a custom post type instead of get_post_format()
- Using get_template_part to retrieve a template file based on current post type
- add a hook with get_template_part()
- ä/ü/… are not displayed when including via get_template_part()
- Change the file path on get_template_part via plugin
- How to limit the number of Related Posts?
- get_template_part – how to find html file which is being render
- Get_Template_Part And Two Global WP_Query On Frontpage
- The use of get_template_part() returns ‘invalid argument’ loading options
- Passing a variable from the archive page to the default template
- For which reasons can get_template_part’s $args fail to work? (WP 5.8.1 – PHP 7.4.23)
- Can I set a global base path for get_template_part?
- how to use a different template (index.php) in wordpress
- What are the benefits of using get_template_part()?
- Include template file from plugin to theme
- get_template_part doesn’t output all data
- Passing a variable to get_template_part
- Is there any way to use get_template_part() with folders?
- get_template_part vs action hooks in themes
- When is get_template_part() preferable to simply using the template.php files?
- How to add custom content template part for a custom post type on main query using a plugin
- Combining shortcode and get_template_part
- passing argument to get_template_part() or a better way to code
- get_template_part execute with ajax
- Get template part based on custom taxonomy term
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- TwentyTen: Overloading template.php files vs. get_template_part
- Accessing $post variable from template part
- Template tags vs get_template_part() vs functions.php
- How to move style from template file to section?
- get_template_part in admin
- Finding Page Template and Displaying Content
- ACF Relationship + WP Template Parts
- Does get_template_part pull data once in a loop?
- Post Format single-loop.php using get_template_part
- Filter get_template_part() $args array
- Is there any way to get all the name or slug of template parts used in a page?
- get_template_part for each level of taxonomy term
- What is the best way to organize template parts?
- Get template part using a custom taxonomy term
- Get_template_part inside a folder
- add active class based on permalink and url
- Overriding of the template for the Attachment “thumbnails” in the Media Grid isn’t working
- Styles and scripts inside template part
- How to show “teaser” posts on blog / archive pages, otherwise full posts
- Modify foreach loop for social sharing links?
- get_template_part based upon post’s category
- Loading template parts conditionally in Customizer
- How do I display an image before the first post of the loop when I’m using get_template_part?
- Tag page only display 10 posts
- Remove portion of header code from home page only
- Use a separate template for the home page only
- How do I get standard posts to open up in their own template when using get_template_part()?
- get_template_directory_uri() not working
- How to reuse get_template_part() containing a simple loop to work with AJAX correctly?
- How to use template inside plugin shortcode with variables for big HTML code
- Both the require and add_template_part function are not including the file
- Displaying a custom post type using get_template_part into a specific layout
- get_template_directory() returns wrong address on VPS
- Get template part with CPT and Custom Taxonomy conditionals
- How can have a conditional template tag based on the main loop within a secondary loop with new WP_Query(), using get_template_part()
- Use of IF statement in Header file
- Organize template parts and page templates in folders in regards of template hierarchy
- Custom fields in post later used in loop
- Exclude function from homepage only?
- How to get all template files used for rendering a single post/page?
- how to replace h1 entry title with h2 in category pages only
- Custom wp_query inside a conditional stament inside a template part doesn’t work: why?
- Contain multiple page templates in one PHP custom template file in WordPress?
- Adding a second loop breaks everything
- do_action doesn’t trigger if it’s in a template that gets loaded via REST endpoint
- Shortcode and get_template_part
- How can I show contents of a template part inside of another page?
- Call get_template_part() custom permalink
- Continue loop after $queryObject
- Use another theme template in my theme
- When using shortcode, content stops generating after the_content
- Using require_once for parent-directory not working but is working in sub-directories
- How to unregister sidebar for template_part?
- Is it possible to call a template file inside wysiwyg editor? And how?
- Re-using single CPT code with get_template_part?
- get_template_part() to render single page Theme
- strange parse error when including a loop template within another template
- Print post data inside loop using theme content template
- First post outside of loop, homepage only?