Closed cynthianorman closed 2 months ago
This Intermediate Theme Developer Learning Pathway Lesson is ready to be reviewed. Please follow the steps listed under Guidelines for reviewing content. Thank you for your contribution! ✨
https://youtu.be/VAgtcFktQZE (unlisted)
@cynthianorman, the lesson does a great job explaining the topic.
However, I'm a bit confused about the items mentioned in the Learning Objectives:
Explain how WordPress uses the query string Briefly explain the template hierarchy diagram Describe the template hierarchy for a given page being queried
Can totally be my lack of understanding, but I couldn't figure out how the first part (query string/permalink) relates to the template hierarchy :-)
@ironnysh if you think about how the data is stored within the wp_posts table. For a page we'll find post_type=page The id of the page corresponds with the given post type so WordPress knows to look for page templates and follows left to right to see if the file exists. Does this help? Here's more info https://developer.wordpress.org/themes/basics/template-hierarchy/#the-template-file-hierarchy
Thanks for the explanation and the link, @cynthianorman. Alright, this makes much more sense--I guess the part that threw me off was the focus on permalinks
@ironnysh I was thinking after the Sample Page loads I could go into the database table and show how WordPress now knows what template to look for because of the post_type value.
Would my example tie things together better? I want this concept to be solidified in people's minds.
Thanks for your help!
go into the database table and show how WordPress now knows what template to look for because of the post_type value
Sounds perfect!
Thanks for being attentive :-)
Youtube URL: https://youtu.be/sDWvuYzeW4E
@jonathanbossenger
(0:07) Learning objectives (0:23) Explain how WordPress uses the query string (2:46) Briefly explain the template hierarchy diagram (3:23) Describe the template hierarchy for a given page being queried (4:07) Next steps
//publish
Details
Learning Objectives
Related Resources and Other Notes
Automation Code