[Resolved] How to create page templates for children's theme?

Home Forums Support [Resolved] How to create page templates for children's theme?

Home Forums Support How to create page templates for children's theme?

Viewing 13 posts - 1 through 13 (of 13 total)
  • Author
    Posts
  • #160465
    Oleg

    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.
    1

    #160471
    Tom
    Lead Developer
    Lead Developer

    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.

    #160473
    Oleg

    No, I did not create the template. This is an image of what I want to do.

    #160474
    Tom
    Lead Developer
    Lead Developer

    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/

    #160541
    Oleg

    Thank you!
    Templates are work only for the pages. How to add templates for post and custom post types?

    #160637
    Tom
    Lead Developer
    Lead Developer
    #419675
    Todd

    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”?

    #420310
    Tom
    Lead Developer
    Lead Developer

    Hmm not that I’m aware of unfortunately.

    #420668
    Todd

    No Problem, thank you. I can change the template in the Quick Edit, so that works pretty well.

    #1148434
    Rui

    And how to create a custom page template if we have no child theme?
    It is possible using code snippets or so?

    #1148470
    Leo
    Staff
    Customer Support

    Child theme is definitely needed for that 🙂

    #1438687
    Joseph

    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.

    #1438790
    Leo
    Staff
    Customer Support

    Thanks for sharing!

Viewing 13 posts - 1 through 13 (of 13 total)
  • The topic ‘How to create page templates for children's theme?’ is closed to new replies.