Add default meta data to a page/post template
Add default meta data to a page/post template
Add default meta data to a page/post template
Template adding to the page
Turns out i had to hook in using “single_template” to add my theme file to the top of the stack. e.g. add_filter(‘single_template’,…..
Display A Post At A URL without Redirecting
There’s a couple things you could do. If we follow the Template Hierarchy you could rename your content-attachment.php file to attachment.php and remove image.php. This will ensure that the image view will fallback to attachment.php. If you want to use content-attachment.php then you could use the template_include hook to tell WordPress to load in which … Read more
Question: why doesn’t it use news.php? This is due to a design decision. If you look at the diagram for the Template Hierarchy, you will notice that the Blog Home page type (black box) has a line connecting directly to the home.html primary template (blue box) with no options in between. If you go to … Read more
Does anyone have any suggestions on how to disable certain template parts in a child theme using theme.json in WordPress with Gutenberg? Using only theme.json this is not possible, and runs counter to the vision for full site editing. In the future it’s possible that not only the parent theme templates might be visible, but … Read more
WordPress template restored by mistake
How to load php templates from html page (block theme)
This is because the code uses require_once which only loads and runs the file once. require would fix the problem, but it would actually be better to use get_template_part() instead. This would allow you to use template filters, block templates, and child themes. get_template_part( string $slug, string $name = null, array $args = array() ): … Read more