php – Does wordpress templates always in files or in database?
But there is no content directory in template directory.
Actually, with the following:
get_template_part( 'templates/content', 'header-private' );
get_template_part( 'templates/content', 'header-public' );
WordPress will search in the templates
folder for content-header-private.php
or content-header-public.php
, and if found, it is loaded. Else, WordPress will attempt to load the content.php
file instead.
So WordPress (or get_template_part()
) will not search in a folder named content
, and instead WordPress will search for PHP files where the name begins with content-
. And if none found, then content.php
is loaded, if it exists.
Check out the get_template_part()
documentation for more details about (using) the function.
Leave an answer