Don’t name your custom page template files page-{foobar}.php
. Doing so will cause just this conflict with the Template Hierarchy for static pages:
- custom template file – The Page Template assigned to the Page. See get_page_templates().
page-{slug}.php
– If the page slug is recent-news, WordPress will look to usepage-recent-news.php
page-{id}.php
– If the page ID is 6, WordPress will look to usepage-6.php
page.php
index.php
Which means that, if you assign a custom page template to the page, WordPress will use that, first and always.
Solution:
- Rename
page-login.php
astemplate-login.php
- Add the
Template Name: Login Page
totemplate-login.php
- Assign the
Login Page
template to your static page named “Login”
Related Posts:
- Custom templates not showing up in template dropdown
- Get page id by template
- Change page template programmatically ?
- Listing pages which uses specific template [duplicate]
- Is there a way to change the default page template selection?
- Hide page visual editor if certain template is selected?
- Creating a template using a specific slug name, for a page with a parent page
- Limit number of pages that use a specific template?
- Hide page visual editor if template is selected – redux
- WP is not using the select custom template.php that its selected for a page
- Is it possible to set a page template on a dynamic home page (articles list)?
- Page template gives ‘Parse error: syntax error’ when used, but no error found!
- more tag in the $post->content when get_pages were used
- Why is custom template not seen as page with is_page()?
- Page with page template not using template in Preview
- Template for child pages / subpages
- How to dynamically save a selected option from page “Templates” selectbox?
- Include a specific page in your template
- Custom page template not working
- How do I create a separate page for each author?
- How do I pass data from page content to the underlying PHP template
- How do i change page template in bulk?
- Load specific page template based on URI
- I have index.php and other files, how do I display other pages?
- is_home() returns TRUE on page template
- Using Pages to handle calls for custom post types
- How to make tag post listing page working?
- Custom page template with entirely different design. Is it possible in?
- How to make my category archive behave like a page
- Page template no longer exists – metaboxes won’t save
- Remove Content edit box from ALL pages (not posts)
- Is it possible to activate page template without manually selecting it in wp-admin?
- Hide page templates without using ‘unset’
- the_content of template page
- Use same page-mypage.php template for several pages
- pre-existing data, and entities
- Rewrite to load homepage for a different url
- Avoid pages losing template association on site re-deploy
- Need to create a custom page on a website
- List child pages within page template
- Using page-something.php as static front page
- Best way to organize data in this scenario
- creating single page with 2 columns while theme is 3 column
- Using index.php as page template
- How does wordpress link page templates to individual pages
- Create custom page to author.php
- Template field missing in page attributes
- Different template parts when on different pages
- Updating page template pragmatically
- WordPress blog posts template bug [closed]
- Adding styles/scripts to specific page
- WordPress form submit to custom page template does not work
- Display grandchild page content on parent page
- How do you assign custom template for Posts page (under Front page displays setting)
- display different pages content on single page
- How to output different content of page on different places in my template
- Avada Theme – Display results from a specific category [closed]
- Multiple pages to show posts
- How to finish this loop?
- Auto-Create Pages from Template Directory
- Loading custom jQuery and HTML in a WordPress page
- different single.php for different page templates
- how bbPress and buddypress add their own page templates to the page template drop down on the page editing screen
- Naming custom page templates
- How can I use Page editor for two separate templates?
- Display random page
- How to read a page’s “Shortcodes” from the Template File?
- if and else statement not working on the iframe php page
- Custom SINGLE page with custom metaboxes and custom template
- I reached halfway through a WordPress tutorial to find out I began wrong for a new comer to WP
- Custom template is not showing up in templates dropdown list after re-naming it
- May I know where to edit the tax rate?
- Pass PHP variable to javascript
- How do I set and list page_template with wpcli?
- Subpages return 404 error [closed]
- User capability of create page/new page
- Trying to edit the single page from a Custom Post
- Using page slug in array
- How to include local menu based on page id?
- Shortcode produces blank page
- Creating a 3-column layout on a WordPress Page
- Create page that is not deletable
- Location-Based Pages displaying results near customer
- Multiple alias for single page
- Add categories and posts to page hierarchy
- Putting two themes together to create a complete site
- Admin taking a very long time to load
- WordPress Site Page Exists but Error 404
- How to capture GET argument on static page
- How to create cutom link for page
- Outputting content from page
- Use an archive as the parent of a page?
- products category page editing
- wordpress page navigation numeric pagination showing same posts on each navigation
- WordPress dosn’t save page/post updates
- WordPress Page All Content In Template Good Or Bad Convention?
- WordPress white screen with “All Pages”
- Can’t select a page using is_page()
- Does WordPress list all pages for crawlers?
- How to display child page from specific parent page in homepage?