Forums

Using custom page.php (3 posts)

  1. yaralian
    Member
    Posted 1 year ago #

    Hi,

    I use a template which uses page.php to display static pages (not posts). The problem is that I have 3 pages which each need to have a separate page.php. I know which pages these are so I can hardcode it if needed, but how I do make WP understand what I want?

  2. Harrison O.
    Member
    Posted 1 year ago #

    First, creating your templates if you don't have them yet.
    Page.php is the default page. Get that, replicate it and rename it; creating:
    page_templateA.php
    page_templateB.php
    page_templateC.php
    Now on top of those pages, you'll probably see this code
    <?php get_header(); ?> add this code above that and on every page you created. *use different names for each.

    <?php
    /*
    Template Name: Template A
    */
    ?>

    Upload the pages to your server/ within your theme files.
    Now, go to edit your pages and under the "page attributes" > Templates > use the dropdown to select the template you created > update your page.

  3. yaralian
    Member
    Posted 1 year ago #

    WOW... so amazingly easy to do. Thanks a lot. I really appreciate the help.

    John

Topic Closed

This topic has been closed to new replies.

About this Topic