Site logo

Archived topic

custom page template - how to?

3 replies · Started by AdB on July 27, 2020

Viewing posts 1–4 of 4

Hi, I'm trying to create a custom page template in order to use it with advanced custom fields.

So I duplicated and renamed the page.php file (let's say information-page-template.php) . I see that the "content" of the page are loaded via the "content-page.php" file.

So I guess I need also a second content-page.php file, right?

How do I assign the new content-page.php file to the information-page-template.php file?
thank you!

Davide

Hi there,

thats correct.
In your custom template, replace:

get_template_part( 'content', 'page' );

with:

get_template_part( 'content', 'my-slug' );

This assumes your custom content template is named: content-my-slug.php

perfect, thank you!
Davide

You're welcome

This archived topic is closed to new replies.