Creating and using custom page templates

The process of creating a new page template is relatively simple. First, we need to create a file on the root folder of the theme. Let's name the template fullwidth.php. Next, we need to add the following comment to the top of the fullwidth.php file, as follows:

/* Template Name: WPQuickStart Full Width */

The preceding comment will register this as a page template, and WordPress will load it as an option in the page creation screen. In the Twenty Seventeen theme, page design contains two columns where the title is displayed on the left and the content is displayed on the right. The left column takes almost half of the page and hence is not ideal for some pages in websites. Therefore, our full width ...

Get WordPress Development Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.