Template Documentation

Variables

At the top of every PHP page in this template, there are six available variables you should edit.

$title

For this current page, this variable is set to:

$title = "Template Documentation";

This is the page title, but it is only half of the <title> tag that the template creates. The template assumes you want to include the title of the page AND the title of the website in the <title> that is displayed by the browser. The title of the website is defined in the main functions file in $sitename variable. The function the_pagetitle builds the <title>.

For this current page, the complete <title> is:

<title>Template Documentation | brandonmoeller.com</title>

The combined title shouldn't be more than 60 characters, an SEO best practice.

This $title variable is also used in other functions, like the social sharing meta functions.

$metadesc

For this current page, this variable is set to:

$metadesc = "This section helps explain how this template works.";

This is a meta description. It should be the best sentence or two from the page. It should be no more than 155 characters long, an SEO best practice.

$site

For this current page, this variable is set to:

$site = "docs";

This page is part of the docs, and this variable is used in function files to determine what CSS and JS assets are included in the header and footer, if applicable.

$page

For this current page, this variable is set to:

$page = "docs-template";

Each page needs its own unique ID, declared in one place, here.

The formula for this variable follows the URL structure of the page, and is usually the $site variable plus a hyphen plus the name of the page, or the name of the directory if the page is an index.php file. Following this formula will set you up to be able to guess the page's variable without opening the file to look at it ... which will help later on when you decide to use the variables in functions.

Front pages need "-home" at the end, and this is added automatically by the make-subsite.php function that creates subsite shell structures.

Optional Overrides

$titleoverride

For this current page, this variable is set to:

$titleoverride is not set.

If you want to override the templated title ( $title | $sitename ) on this page only, use this in addition to $title. But you still need to set $title.

$socialimageoverride

For this current page, this variable is set to:

$socialimageoverride is not set.

This overrides the $socialimagesitewide in the site's functions file, which overrides the default image ($socialimage in the main functions file) optimized for social media sharing.

Social images should be 1200 pixels wide by 603 pixels tall.