Custom page/template

Been reading over the information. But am still unclear so hope you folks out there can clarify for me.
Normally to create a custom page base on a custom template i would:

1.wp-admin> create page & assign the template.
2.editor/text editor> used index. page. save as “whatever” in .php “Template Name: Whatever” then customize it.

in Root…And am getting lost here…

  1. base-whatever.php would be a new wrapper (try not to do that)
  2. page-whatever.php would be a new page,
  3. go to: templates/content-whatever.php would be the new content.

Is this correct? how do I assign this new page, to the wp-admin page?
thx
D

You’re overcomplicating things. Creating a custom page template in Sage (not ‘Root’) is the same as any other WordPress theme. https://developer.wordpress.org/themes/template-files-section/page-template-files/page-templates/#creating-custom-page-templates-for-global-use

There’s even one already in Sage as an example. https://github.com/roots/sage/blob/master/template-custom.php

Also, you don’t need to sign your posts — https://discourse.roots.io/faq#keep-tidy

1 Like

All right! progress.

  1. created in the root a page-exec.php
    "Template Name: Exec"

then I use

<?php 
$page_posts = new WP_Query( array( 'tag' => 'exec' ) );
include(locate_template('templates/content-execs.php'));
?>

Is this correct. Seems to work.