- This topic has 1 reply, 2 voices, and was last updated 5 years, 4 months ago by .
- The forum ‘General Discussion’ is closed to new topics and replies.
These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.
I am a bit confused about how single view is working on Genesis.
Looking at the Template Hierarchy if I want to modify both the single article view and the single page view I could use a file named
Well I've tried it but is not working in Genesis.
I've searched around but I did not find any simple solution to it.
I understand that WordPress does not load this file because it finds the
single.php file in the parent theme and is not a big issue to create this file in my child theme instead of the more general one
Anyway I would like to know if any of you have found a solution about it because I think this is the right approach since it follows the WordPress Rulez.
Thank you in advance,
SkillsAndMore: the italian go to resource for web development.
singular.php will not override page.php because of the Hierarchy https://developer.wordpress.org/themes/basics/template-hierarchy/#single-page
single.php for posts.
page.php for single pages.
Otherwise you could use a template_include filter to load the same file on single posts and pages but it's not as efficient.
Another option is to use the single_template filter.
Or, you can use 1 page template for any post type using a header like this :
// Template Name: Any Post Type Template // Template Post Type: post, page, portfolio
And name the file anything you like.
© 2023 WPEngine, Inc.