A while ago i started a new Wordpress project. But i got into an issue. Since there are multiple designs i need to create multiple templates for pages, posts and text format outputs for on the different page-templates.
So since the're are so many template files i wanted to create some subdirectory's. i know that since Wordpress 3.4 and higher you're able to use the subdirectory name page-templates for all the page templates but how could i use that for the format files and for the post files.
Yes i did try to add functions like:
get_template_part('/template-parts/page-templates' , 'page');
And
require( get_template_directory() . '/template-parts/template-tags.php' );
The ideal directory structure i would like to create is as follows:
wp-content/themes/mytheme
- archive
- 404
- CSS
- JS
- Images
- template-parts (dir)
-- page-templates (dir for page-template files.)
-- format-templates (dir for format-templates.)
-- post-templates (dir for post-templates.)
- header
- footer
So to be clear. I want to create the structure for template files like above. Don't mind the folders like CSS etc. Those are set the correct way. The intention is, after i've succesfully created the structure, to be able to select the templates like a page temple from the /wp-admin edit page section.