Is there any way to change the folder stucture in wordpress? (2 posts)

  1. f00bar
    Posted 5 years ago #

    Hi everyone

    Not really sure if this is possible (or at least if it is, maybe not easy) but I really would like to change the folder structure in my custom theme. I have a lot of page templates and extra files for functions and it's looking messy.

    Ideally I'd like something along the lines of:

    dir: "php" -> contains all main files, such as header.php, footer.php, 404.php etc.
    dir: "templates" -> contains my templates, such as page.php, single.php, homepage.php (custom)
    dir: "css" -> contains style.css and any other custom CSS.

    I'm not sure where the "bloginfo()" command pulls its data from - can't find it anywhere in the database so I wouldn't know how to easily change it.

    Has anyone managed to alter file/folder structures safely in themes?

    Thanks in advance

  2. esmi
    Forum Moderator
    Posted 5 years ago #

    All of your template files need to be in the root theme folder along with style.css & functions.php. But you could store your .css files in a sub-folder and import them into style.css. Or use <?php bloginfo('template_directory'); ?>/sub-folder/foo.css. I also often store functions files in a sub-folder and use functions.php as a master calling file.

Topic Closed

This topic has been closed to new replies.

About this Topic