1
$locate = locate_template( 'widgets/the-post-widget.php' );

I am using the above path and method to include a file in functions.php, but that is not happening.

The file doesn't seem to include. Am I doing a mistake?

2

locate_template just returns the filename of the template. If you want to load the template, set the second argument to true:

locate_template( 'widgets/the-post-widget.php', true );
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.