In fact you can, I have a folder in my theme directory called /partials/
in in that folder I have files such as latest-articles.php
, latest-news.php
and latest-statements.php
and I load these files using get_template_part()
like:
1 2 3 4 5 6 7 8 | /** * Use get_template_part() with folders. */ get_template_part('partials/latest', 'news'); get_template_part('partials/latest', 'articles'); get_template_part('partials/latest', 'statements'); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.