logo
Ask your WordPress questions! Pay money and get answers fast! (more info)

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.

$15
Hiding page templates

I have created a variety of page templates for my site. Two of these templates are for a specific purpose - one gets applied to the homepage, the other to a contact page. Is it possible to hide my ‘Homepage’ and ‘Contact’ templates from WordPress’s template list (Page Properties > Templates) once they have been associated with their respective pages?

Basically, once these templates have been associated with the relevant pages, I don’t want the user to accidentally associate further pages with either of these templates.

This question has been answered.

designbuildtest | 07/24/12 at 9:44pm Edit


(2) Possible Answers Submitted...

See a chronological view of answers?

Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

  • avatar
    Last edited:
    07/24/12
    9:52pm
    Fakhri Setiawan says:

    yes, use this plugin : http://bradyjfrey.com/blog/wordpress-plugin/cloak/

    • 07/24/12 10:00pm

      designbuildtest says:

      Not what I'm looking for sorry Fakhri. I need a simple function that can be dropped into functions.php rather than a full-blown plugin. Thanks.

  • avatar
    Last edited:
    07/24/12
    10:03pm
    Navjot Singh says:

    Easiest way to hide them after associating them is to remove the top comment lines from the corresponding template's php file. That way it won't be recognized as template anymore and won't show in the drop-down list again.

    • 07/24/12 10:35pm

      designbuildtest says:

      Perfect. Thanks Navjot.

    • 07/24/12 11:04pm

      Navjot Singh says:

      You still haven't voted for me?

    • 07/25/12 7:00pm

      designbuildtest says:

      Hi Navjot, originally I thought this was the perfect answer to my problem but unfortunately this method does not work.

      If the user subsequently makes an update to either the Homepage or Contact us page, the applied template is lost and the page reverts to the default WordPress page template (page.php).

      Any suggestions for an alternative solution?

      Thanks

This question has expired.



Navjot Singh had additional discourse to offer.

Gabriel Reguly, designbuildtest, Hai Bui voted on this question.



Current status of this question: Completed



Warning: Please do not give out any FTP or ssh credentials to anyone, unless you trust them completely. Giving out login details is dangerous.

If the asker does not get an answer then they have 10 days to request a refund.