• QUESTION
    Can I add a new folder for page templates, and tell WordPress to scan that as well as the theme root?

    I found get_page_templates() in /wp-admin/includes/theme.php, but want to avoid hacking it. What’s the right way to handle this situation?

    EXPLANATION
    We’re developing a theme, kind of like Thesis, that will be used and customized for many sites. Custom files and settings for each implementation will go in the /custom/ folder of the theme — thus the need for WordPress to be able to scan a folder outside of the theme root.

Viewing 4 replies - 1 through 4 (of 4 total)
  • could you use some kind of conditional include in your existing theme template, so inside header.php.. if ../custom/header.php exists include that else use the standard code.

    Thread Starter Nabha Cosley

    (@nabha)

    That’s a good idea — it works for part of the solution. Thank you.

    Still there’s the problem of how a user can add as many template pages as they want.

    I’ll keep thinking, or maybe ask in the hacking forum, if that’s a more appropriate place.

    I would’ve thought you could do this by setting up relevant theme options, a little on that here https://blog.themeforest.net/wordpress/create-an-options-page-for-your-wordpress-theme/

    Thread Starter Nabha Cosley

    (@nabha)

    Thanks, that looks like a great article (I’ll save it and read it!). What I need, though, is a way for new page templates to be scanned and incorporated into the WordPress page management system, just like regular custom page templates. I couldn’t figure how that would tie into theme options.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Scanning another folder for page templates’ is closed to new replies.