Unable to include a template

On the home.php, which is in the same folder where style.css is kept I am try to call a template: <?php get_template_part( ‘template-parts/content’, ‘home-default’ ); ?> template-parts is a folder which is in the root folder same where we have style.css, like – theme-directory — template-parts — content-home-default.php — style.css — home.php Template is: content-home-default.php … Read more

how to remove get_template_part from a plugin? [closed]

Closed. This question is off-topic. It is not currently accepting answers. Your question should be specific to WordPress. Generic PHP/JS/SQL/HTML/CSS questions might be better asked at Stack Overflow or another appropriate Stack Exchange network site. Third party plugins and themes are off topic, they are better asked about at their developers’ support routes. Closed 3 … Read more

Problem with using get_template_part() in footer

First off let me just say, I’m new to theme development, I hope there isn’t something obvious I’m missing. I’m trying to get this form contactform.php <form method=”POST” action=””> <input type=”text” name=”contact_name” placeholder=”Name” class=”form-control” required> <input type=”email” name=”contact_email” placeholder=”E-Mail” class=”form-control” required> <textarea name=”contact_message” placeholder=”Message” rows=”4″ class= “form-control” required></textarea> <button type=”submit” class=”btn btn-secondary”>Send</button> </form> <?php //process … Read more

How to pass variables with get_template_part?

I am developing a custom theme and i like to pass some variables to selected files. I am calling the view files from functions.php. $var1 = ; $var2 = ; etc include_once(‘form-views/view-profile.php’);//works //get_template_part(‘includes/form-views/view’,’profile’);//doesn’t work Now with include it works 3 Answers 3 This is essentially scope visibility issue. include brings code into a current scope, … Read more