• 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
    Michael

Viewing 1 replies (of 1 total)
  • 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.

Viewing 1 replies (of 1 total)
  • The topic ‘Is there any way to change the folder stucture in wordpress?’ is closed to new replies.