How add custom template

We have a php file that we played in root of child theme but how do we call it via theme?

Thanks
Christina

Hi Christina,

Thanks for reaching out.

May I know where you wish to display it? It depends but it’s usually something like this

//the usual PHP calling for  /x-child/filename-sample.php
include( get_template_directory() . 'filename.php' );

or

//the Wordpress standard function for calling  /x-child/filename-sample.php
<?php get_template_part( 'filename', 'sample' ); ?>

or

//X's view template calling /x-child/framework/views/{ACTIVE STACK}/filename-sample.php
x_get_view( x_get_stack(), 'filename', 'sample' );

//X's view template calling /x-child/framework/views/global/filename-sample.php
x_get_view( 'global', 'filename', 'sample' );

But either way, the line of that code should be added to where you wish to call them.

Thanks!

Great - Thank you!

You are most welcome. :slight_smile:

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