Is there a way to create templates in wordpress? A client

Hi,
Is there a way to create templates in wordpress? A client wants to be able to simply update certain content easily and all the formatting remain in in tact.

Corn

  • Predrag Dubajic

    Hey @cornelius_butler,

    Hope you're doing well today :slight_smile:

    It certainly is, and it's one of the reasons we love WordPress :slight_smile:

    Creating template is as simple as creating new .php file in your theme folder and add this part at the start of the file:

    <?php
    /*
    Template Name: My Awesome Custom Page
    */

    Just change the name in code for different templates and they will be available in your picker when creating new page in WP admin.

    Other things you need to include is get_header(); after the first part of code and get_footer(); at the end of file.

    Between those you can now add what you want and do magic.

    Here is a simple example template which will show page title and page content:

    <?php
    /**
    * Template Name: Custom Page
    */
    get_header(); ?>
    
        <h1><?php the_title();?></h1>
    
            <div class="content-holder">
                <?php the_content(); ?>
            </div>
    
    <?php get_footer(); ?>

    You can find more info in this blog post:
    https://premium.wpmudev.org/blog/creating-custom-page-templates-in-wordpress/

    Hope this helps you get started.

    Best regards,
    Predrag

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.