Add page template to child theme

Hi, I’ve to add a template to my Pro child theme, which is running the integrity stack. I’ve done this by adding a file (I’ve named it “template-blank-4A.php”) in the child theme’s directory under framework/views/integrity/. However, I do not see it when I try to add a new page. The header of the file looks like:

<?php

// =============================================================================
// VIEWS/INTEGRITY/TEMPLATE-BLANK-4A.PHP (No Container | Header, Footer | FB Like Enabled)
// -----------------------------------------------------------------------------
// A blank page for creating unique layouts.
// =============================================================================

// adds code to download Facebook JavaScript SDK
// 8-23/17 Max

?>

Any ideas?

Hi @mbachrach,

Thanks for writing in.

I could not be able to check if where you have done it incorrectly. In this, please share us your admin credentials and FTP so we could check your setup closer.

Don’t forget to set it in secure note.

Thanks. :slight_smile:

I created a secure note with login information. let me know what you find.
thanks

Hi there,

What you did is just a template part, you need the main/root template too which is located in theme’s main folder.

Example,

/x/template-blank-1.php << this is the root where the codes call the template part /x/framework/views/integrity/template-blank-1.php

You must do the same template structure in your template. Examples

/pro-child/template-blank-4a.php
/pro-child/framework/views/integrity/template-blank-4a.php

And the code should match the template, example, in /pro-child/template-blank-4a.php

<?php

// =============================================================================
// TEMPLATE NAME: Blank - No Container | Header, Footer A
// -----------------------------------------------------------------------------
// A blank page for creating unique layouts.
//
// Content is output based on which Stack has been selected in the Customizer.
// To view and/or edit the markup of your Stack's index, first go to "views"
// inside the "framework" subdirectory. Once inside, find your Stack's folder
// and look for a file called "template-blank-4.php," where you'll be able to
// find the appropriate output.
// =============================================================================

?>

<?php x_get_view( x_get_stack(), 'template', 'blank-4a' ); ?>

It should call the /pro-child/framework/views/integrity/template-blank-4a.php, then in your page templates, choose Blank - No Container | Header, Footer A

Thanks!

I did as you suggested, but still do not see the new template. Please take a look at what I’ve done. thanks

Hello There,

We have checked your modified template files in the child theme and it seems correct. We cannot check if the page template is now available since we do not have any access to your WP site. Could you please provide some WP access? By the way, please make sure that the child theme is active or else nothing will happen.

Please let us know how it goes.

OK. I’m sending you login info by a secured note.

Hello There,

Thanks for updating in! Could you please make it as a “Super Admin” so that we can check the child theme files in your network settings?

Thank you in advance.

OK: I’ve made it super admin.

Hi,

Upon checking I can see you have deleted the TEMPLATE NAME: in template-blank-4A.php

Please note that it is needed for your template to show up in the Template Options.

Kindly change this

// =============================================================================
// VIEWS/INTEGRITY/TEMPLATE-BLANK-4A.PHP (No Container | Header, Footer | FB Like Enabled)
// -----------------------------------------------------------------------------
// A blank page for creating unique layouts.
// =============================================================================
//
// adds code to download Facebook JavaScript SDK
// 8-23/17 Max

To


// =============================================================================
// TEMPLATE NAME: No Container | Header, Footer | FB Like Enabled
// -----------------------------------------------------------------------------
// A blank page for creating unique layouts.
//
// VIEWS/INTEGRITY/TEMPLATE-BLANK-4A.PHP
//
// adds code to download Facebook JavaScript SDK
// 8-23/17 Max

For more information, you may refer to the link below

Thanks

That did the trick: thanks for your help!

You’re welcome.