Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Custom Page Templates Do Not Show In WordPress Drop Down

Recently I was working with a theme in one of our client’s Wordpress website. I needed to create Custom page templates to meet the requirements.

I created a couple of custom page templates but I got frustrated when I was trying to link those templates to some pages within the WordPress website and I couldn’t find the templates in the template dropdown within the WordPress page editor.

With all my experience I tried a couple of things and one of them worked and the custom page templates which I created started showing in the dropdown.

Here is what I tried.

WordPress custom page template problem

WordPress themes usually come with ready templates. These templates can be linked to WordPress pages from the dropdown towards the right in the WordPress page editor.

These are times when you cannot find the custom page templates you have created in the dropdown.

How to make your custom page template display in the drop down

First option you can try is reset your theme.

This means you can switch to another theme for a minute and then switch back to your own theme. This resets your theme and it may work. It is just like when you reboot your computer after you install an app or a software.

But I wasn’t that lucky and unfortunately it didn’t work for me.

I couldn’t find much help online so I decided to recheck my custom page template and compared it with other custom templates which were showing in the drop down.

Everything looked alright.

I couldn’t find a single error in the php code of the custom page templates I created.

After going through the templates again and again I realised that the only thing which was missing in my custom page templates is the small piece of php comment which is always there at the top of any page template in WordPress.

/*
Template Name: Custom Page Template Name
*/

This php comment is used by WordPress to identify the page templates. It sounded strange but it is true that if your custom page template is missing this small comment then WordPress will not read your template.

So you need to make sure that your custom page template in WordPress has a proper comment which shows the name of the template.

The post Custom Page Templates Do Not Show In WordPress Drop Down appeared first on ICO WebTech Pvt. Ltd..



This post first appeared on Outsourcing Company|Web Design|SEO|Data Entry, please read the originial post: here

Share the post

Custom Page Templates Do Not Show In WordPress Drop Down

×

Subscribe to Outsourcing Company|web Design|seo|data Entry

Get updates delivered right to your inbox!

Thank you for your subscription

×