• I’ve cloned my production site. Updated the clone to WP5.0.1 and am trying to achieve what I need to do with Twenty Nineteen.

    I use custom page templates to run PHP and MYSQL requests to custom database files.
    The template selector has disappeared from the page attributes dropdown but this poses no problem if the page template file name corresponds to the created page name.

    To create a page template I copy and rename the theme’s page.php to template_”page name”.php.

    I insert the template name at the top of the template file and insert my custom PHP code.

    But where? There seems to be no obvious place to insert content.

    Could the solution lie in the template-parts sub-directory?

    • This topic was modified 5 years, 11 months ago by zagga50.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Yes, many themes are written this way.
    Hopefully your changes are being done in a child theme.
    It sounds like a better solution for you would be to write a small plugin that creates a shortcode, which you then put into your pages. Then you can change themes at any time without having to make new page templates.

    Thread Starter zagga50

    (@zagga50)

    Thanks Joy.

    I’ll look into this.

    Gary

    I am very frustrated by the lack of information concerning the new structure regarding template parts. For newbies, it’s very difficult to stay up to date with each theme update especially when there is such disappearance of the template selector which was by default in twenty sixteen.

    The info in www.remarpro.com talks about the templates directory and not the template-parts. It does not either mention that the templates are not supported the same way.

    Maybe I am wrong and you can direct me in the right direction?

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Using custom page templates in Twenty Nineteen’ is closed to new replies.