get_template_part doesn’t output all data
It’s sounds like js errors. Check from chrome console for possible errors. Also why are you loading the contact-us template using get_template_part function?
It’s sounds like js errors. Check from chrome console for possible errors. Also why are you loading the contact-us template using get_template_part function?
Not sure it is the best idea to try to run a plugin “in” your theme like this – it won’t get updated as the plugin is updated. You say you have “included all the files” from the plugin, but now you are trying to call admin-config.php with get_template_part when it is not a template … Read more
Main – Loads a template part into a template. The function provides a mechanism for child themes to overload reusable sections of code in the theme. So you have always the right path, file and a solid chance for developers, other code to change the result. See also this solid answer to a similar question. … Read more
how to use a different template (index.php) in wordpress
Can I set a global base path for get_template_part?
For which reasons can get_template_part’s $args fail to work? (WP 5.8.1 – PHP 7.4.23)
Don’t use get_template_part. Instead use include( locate_template( ‘your-template-part.php’ ) ); This will make your variables available to the included file without having to use the global keyword.
You should have a read here. Kaiser wrote a complete article on this on his blog I quote from that Although get_template_part is similar to a PHP include or require, you should not use it to include things like your theme options code, sidebars registration, custom widgets, etc. The get_template_part function should only be used … Read more
You shouldn’t have to globalize the main $wp_query, only secondary queries. Take the following example, if I have a very simple frontpage.php template it would look like: <?php get_header(); ?> <?php get_template_part( ‘templates/template’, ‘main-query’ ); ?> <?php get_footer(); ?> I can then create a template found in /theme-name/templates/template-main-query.php which has a normal Loop: <?php if( … Read more
The first parameter of the function is the slug and the second is the string for the file, so you’ll look for the directory template-parts/header/ and then the file site-branding. Assuming it’s for a theme, you’ll start in the theme directory and look for the template-parts directory there.