get_template_part
-
I’m trying to use the get_template_part to rehuse the loop for single post pages, but the documentation is not clear, to me at least.
I need to use the same html structure in the single page/post and home templates and another file for multiple-post templates, and I need to know how to name them and how to call them with this function.
The documentation says:
$name
(string) (optional) The name of the specialized template.I don’t know what “the specialized template” means. Is that the kind of pages it will applied to? Is that the template “type” that will be opened when used this function regardless of the kind of template it has been called from? or the template name it will look for?
My theme doesn’t have any child. I’m building it from scratch.
Can anybody give me, at least, a few more examples for me to figure it out, or just expand the above definition
?
Thanks.
- The topic ‘get_template_part’ is closed to new replies.