• [ Moderator note: moved to Fixing WordPress. Please do not use Developing With WordPress for these topics. ]

    Following instructions to the letter, I created two custom page templates. Then, I created two pages. One of them displays both templates in the dropdown box, but the other doesn’t. Have read countless posts in Google and the Forum, to no avail. Please, help!

    • This topic was modified 7 years, 6 months ago by mrcangrejero.
    • This topic was modified 7 years, 6 months ago by mrcangrejero.
    • This topic was modified 7 years, 6 months ago by Jan Dembowski.
Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi mrcangrejero,

    Let me check if I understand you correctly, if I may.

    (1) You relied on guidance from the www.ads-software.com codex to create two custom templates and added them to your theme in your WordPress install.

    (2)
    Within the WordPress dashboard of that site, you created two separate pages.

    (3) Within that dashboard, you can apply your two new custom templates to one of those new pages, but not to the other.

    Is that correct?

    If so, (and I know this is silly) but you have saved both pages? And they are both pages (that is one is a page but the other is a post, for example)?

    Hi @@mrcangrejero
    Can I get your website link?

    Thread Starter mrcangrejero

    (@mrcangrejero)

    To: tabassumnaaz
    See below.
    To: Liam Dempsey
    Your analysis is correct, I was wrong. The template drop down disappears when the page you create will end up displaying the posts; which is what I tried to do. Saved the template as index.php and page.php and now my posts are displayed in the template format I wanted. The only problem that remains is that my original templates both use custom fields and I loose that capability if the site uses index/page.php for posts. I then edited my original template by adding at its head “<?php /* * WP Post Template: Page for Blog */?>” and placed it in the site’s root, but I can’t tell if that makes any difference. Any further help is appreciated. Thanks!

    Hi mrcangrejero,

    You may want to consider your page/template/PHP file naming approach. WordPress relies on a template hierarchy to determine where/how to display content on the front of a site. If you visit the page below, you’ll find more information on this topic.

    https://developer.www.ads-software.com/themes/basics/template-hierarchy/

    Thread Starter mrcangrejero

    (@mrcangrejero)

    Thanks, Liam. Solved the problem by not choosing a blog page in Settings == Reading. My custom template with the loop then delivers what I wanted. The best to you and yours!

    Awesome! Thanks for letting me know.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Page Templates Not Displaying in Dropdown’ is closed to new replies.