Support » Requests and Feedback » Allow Page templates for archives, search, 404, and taxonomies

  • Consider the following theme files:

    • category.php
    • tag.php
    • taxonomy.php
    • author.php
    • date.php
    • archive.php
    • search.php
    • attachment.php
    • image.php
    • 404.php

    Feature request:
    Allow theme developers to add the following value into the top of those files
    /*
    Load as Page Template: True {boolean}
    Template Name: Category Loop {any text}
    */
    Which would result in that theme file being listed in the PAGE TEMPLATE drop menu.

    This would also allow developers to add metaboxes that will trigger when those templates are selected, reducing the number of options needed in an admin panel creating an elegant solution to a complex problem.

    As a direct result that page would not be a ‘published page’, it would not show up in the site map, the URL would not inherit, anytime an admin is on one of those pages the EDIT button would simply take them to it’s “page”.

    When front end users are on those pages the Page Meta values from the assigned page would be available within all WP objects the same way one would expect with a page/post.

    Elaborate description of the problem this feature would solve:

    Currently the only way to accomplish the above feature is to create a non-public custom post type and then assign meta-boxes to take care of a complex array of options which could have been taken care of by pages by default.

    Lets say for example an admin wants to add a different paragraph of text, a different title tag and image to each of the above pages. All of the above force theme developers to take one of the following routes when offering users the ability to customize the output via the Theme itself;

    1. Create 10 page-template.php files, one for each special page above.
    2. Make a new widget for every page using register_sidebar() 10 times.
    3. Add in a minimum of 30 options into an admin panel (text, title, and image).
    4. Create a non-public custom post type and then assign meta-boxes.
    5. Develop extensive code that is ‘questionable’ for WP theme standards.
    6. Suggest a plugin to end users, or make yet another one that does this.
    7. Do nothing, forcing end users to edit the PHP files directly.

    If there is another way to handle this other than what I describe above please let me know. I have had to solve this as “a problem” on every theme I have worked on or built.

    Because this comes up so often (every client wants to change at least 1 of those items), and because there is no “standard” way to handle this within themes (other than PHP edits) I feel it is a good candidate for a feature request.

    Thank you for your consideration in this matter.

  • The topic ‘Allow Page templates for archives, search, 404, and taxonomies’ is closed to new replies.