• Resolved prakin

    (@prakin)


    I am trying to create a new page template, but for some reason the php file is not showing up when I go to Appearances – Editor-Theme Child.

    I’ve tried purging the cache, closing and reopening, still nothing there.
    I checked and rechecked the file.
    I’ve removed everything from the file except for this:

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

    Even though the file is in the wordpress contents’ themes – I still do not see anything when I go back to my blog. What am I doing wrong? I have created other files in the past and this is the first time that I have been unable to get the stupid thing to show up.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Moderator t-p

    (@t-p)

    – When creating a page from wp-admin->Pages, you need to assign this “Template”. Until you do that, WordPress won’t know where to find the “page” or won’t know what to do with the request. Have you done that?
    – If you have not done it, then, while creating/editing pages in the Admin, under “Page Attributes” in the right panel you select a template.
    – Useful codex:
    https://codex.www.ads-software.com/Pages https://codex.www.ads-software.com/Codex:Creating_a_New_Page https://codex.www.ads-software.com/Page_Templates

    Thread Starter prakin

    (@prakin)

    I tried doing that, but I am not seeing an Archives in the drop down attributes.
    It still just has:

    default page
    front page
    full width page
    grid page

    I assumed this was because the child theme is not showing the php file for the new template.
    FYI I read through all of those codex pages before posting here. I know it must be something simple, I just can’t figure it out.

    Just to be clear, these are the steps that I took.

    Open Bluehost, create new file in child themes folder named page archives.php
    copy code from above, save.
    Go to blog, click appearance, click editor, look for file in child theme (not there).

    Moderator t-p

    (@t-p)

    Just a guess, try changing to name to something else (e.g.: prakinarchives), in case its conflicting with something else. Try using lowercase.

    Thread Starter prakin

    (@prakin)

    Thanks! Changed the name and also noticed that my other files have 2 forward slashes before the first asterisk. Not sure which one did the trick (or both), but I see it now!

    Moderator t-p

    (@t-p)

    you are welcome ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘new php file not showing up in child theme’ is closed to new replies.