- This topic has 3 replies, 2 voices, and was last updated 1 year, 7 months ago by .
- You must be logged in to reply to this topic.
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.
Hello I'm wondering if someone can tell me how to get this design: https://demo.studiopress.com/monochrome/minimal-design/ (Monochrome single.php) to apply to pages and custom post types?
I have the custom post types set up to follow the single.php, so that's fine.
Pages still won't show featured the 'big' featured image like on the posts.
When I read WordPress docs here: https://developer.wordpress.org/themes/template-files-section/post-template-files/#singular-php it seems like singular.php is the way to go to get all post types, including page.php to use one template.
I tried changing the name of single.php to singular.php hoping that would work but it didn't. It took away the featured image.
Does anyone know the answer to this?
For CPTs, WordPress requires the template to include the CPT's slug in its name. See this: https://developer.wordpress.org/themes/template-files-section/custom-post-type-template-files/
Than you Victor, but this is not for custom post types. This is for the native Pages in WordPress. I'm trying to get the native Pages to use the same layout as the native Posts, based on the single.php file in Monochrome Pro. It is not doing that, even if I copy the code from single.php into page.php.
Also not sure if you had a look at the link I provided, but my understanding of what it says it that any post type can use singular.php:
"WordPress Version 4.3 added singular.php that comes in the hierarchy after single.php for posts, page.php for pages, and the variations of each. This template follows the rules of is_singular() and is used for a single post, regardless of post type. Themes that used the same code for both of those files (or included one in the other) can now simplify down to the one template."
So I'm hoping I can just use one file, as it says above, instead of creating custom post type templates, single.php templates, page.php templates and so on.
Let me know if I read that wrong...
© 2023 WPEngine, Inc.