Viewing 3 replies - 1 through 3 (of 3 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hi kcaluwae,

    1. Creating Custom Page Templates:

    WordPress allows you to create custom page templates to change the look and feel of specific pages or groups of pages.
    Here’s how you can create custom page templates:

    • Navigate to your WordPress dashboard.
    • Go to Appearance → Editor to open the Site Editor.
    • Click on Templates.
    • Click the + icon to add a new template.
    • You can either select one of the built-in options or create your own template using the Custom template option at the bottom
    • Give your template a name .
    • Save your changes.
    • Now, when you edit a page, you’ll be able to select your custom template from the available options.

    2. Adding a Template Name:
    add an HTML comment at the beginning of your custom template file to give it a name.

    For example:
    <!– Template Name: My Custom Template –>

    • Replace “My Custom Template” with your desired template name.

    Hope it helps ??

    Thread Starter kcaluwae

    (@kcaluwae)

    Hi @addweb-solution-pvt-ltd.
    Thanks for the answer.
    I had tried that approach but instead of choosing the “Custom Template” I always chose “Pages” and then you have to choose a specific page in a next step.

    I completely missed the “Custom Template” at the bottom.

    Thanks!

    Kris

    This mostly works, only the template files are now html files.

    The Twenty Twenty-Three theme is a block theme, and block themes use HTML template files, not PHP files and cannot contain WordPress’ PHP template tags that classic themes use. Of course, you could include PHP template files to create a hybrid block/classic theme.

    Here are some differences between block and classic themes: https://developer.www.ads-software.com/themes/block-themes/

    And here is the temperate structure of a block theme: https://developer.www.ads-software.com/themes/core-concepts/theme-structure/

    As @addweb-solution-pvt-ltd alluded to, you can easily create new templates from the Site Editor in the dashboard without writing any code at all. That’s (part of) the promise of Gutenberg and the reason for doing away with the old PHP-based approach to building themes.

    Good luck!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘How to create new global page template in twenty-twenty-three’ is closed to new replies.