Building a custom template

Are there any guides that exist that describe the process for creating new templates that would work within the Pro theme?

There are a few additional layouts that I would like to build, but can’t seem to figure out how to get them to play nicely in the Pro theme.

I would like to be able to create templates so that they show up in this list:

Hi there,

You can create your custom page theme based in Wordpress standards.

Please check these links for more info:

https://developer.wordpress.org/themes/template-files-section/page-template-files/

But please make sure that you are adding the new template files in the child theme.

Hope this helps you get started.

Cheers!

I am indeed adding the template files in a child theme. However… I find that when I try to model my template file after one of the other Integrity templates, no content seems to pull in.

For example - in my new template, I only have the following code:

<?php
// =============================================================================
// VIEWS/INTEGRITY/TEMPLATE-LAYOUT-CONTENT-SIDEBAR-CUSTOM.PHP
// -----------------------------------------------------------------------------
// Content left, sidebar right page output for Integrity.
// =============================================================================
?>

<?php get_header(); ?>

However, when I preview the page with this template set to it, no header gets pulled in. It is simply an empty set of tags. What am I missing here?

Hi there,

you need to add a new template file at the root level of your Child Theme. For example hello.php which it will contain:

<?php

// =============================================================================
// TEMPLATE NAME: HELLO

?>

<?php get_header(); ?>

  <div class="x-container max width offset">
    <div class="<?php x_main_content_class(); ?>" role="main">

      <?php while ( have_posts() ) : the_post(); ?>
        <?php x_get_view( 'integrity', 'content', 'page' ); ?>
        <?php x_get_view( 'global', '_comments-template' ); ?>
      <?php endwhile; ?>

    </div>

    <?php get_sidebar(); ?>

  </div>

<?php get_footer(); ?>

I copied the content of the wp-content/themes/x/framework/views/integrity/template-layout-content-sidebar.php and added to the hello.php file. And the file itself contains the official method of adding a page template. I added HELLO as the name of the template at the top. You can change it to whatever you want.

I also suggest that you check this article.

Thank you.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.