How do i structure my theme folder to avoid one huge list of files

Not a full answer, but I can at least answer this question:

Also custom post template files can not be in sub directories.

Everything, that you can load via get_template_part(), can reside in a subfolder:

get_template_part( 'subdir/part', 'suffix' );

It’s as easy as that. Now you’ve your part inside

~/wp-content/themes/theme_folder/subdir/part-suffix.php

Slightly off topic.

Then there’re some nice tricks, like using the post format or post type as part name:

get_template_part( 
     'content'
    ,get_post_format()
);

Leave a Comment

tech