Archived topic
How to create page templates for children's theme?
12 replies · Started by Oleg on December 16, 2015
Hello!
How do I create a new page templates? The GeneratePress is not.
I want to create different page templates for different post types. I want to use frontend forms Advanced Custom Fields. I need to edit the php code.

What about it are you having troubles with?
Looks like you've created the page template, so now it would just depend on how you're coding that template.
No, I did not create the template. This is an image of what I want to do.
Ah, copy the page.php template in GP and name it something else - page-whatever.php
Add it to your child theme.
At the top, add this:
<?php
/**
* Template Name: My Template Name
*
*/
Then code as needed.
More info on page templates here: https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/
Thank you!
Templates are work only for the pages. How to add templates for post and custom post types?
This may help: https://codex.wordpress.org/Post_Type_Templates
This is very useful. Is there a simple filter or some method that would allow the page templates to show up in the pages Admin area as an selector under “screen options”?
Hmm not that I'm aware of unfortunately.
No Problem, thank you. I can change the template in the Quick Edit, so that works pretty well.
And how to create a custom page template if we have no child theme?
It is possible using code snippets or so?
Child theme is definitely needed for that :)
For anyone else searching this topic, it appears that any custom page template (even if selected) only takes effect when the page sections checkbox is disabled.
Thanks for sharing!