[wp-trac] [WordPress Trac] #30288: set import directory for get_template_part()
WordPress Trac
noreply at wordpress.org
Sun Nov 9 20:22:21 UTC 2014
#30288: set import directory for get_template_part()
-----------------------------+-----------------------
Reporter: Billy Mathews | Owner:
Type: feature request | Status: reopened
Priority: normal | Milestone:
Component: Themes | Version: trunk
Severity: normal | Resolution:
Keywords: | Focuses: template
-----------------------------+-----------------------
Changes (by Billy Mathews):
* status: closed => reopened
* resolution: duplicate =>
Comment:
To clarify, not necessarily outside the themes directory. I'd like to be
able to separate my page templates from my page partials (such as the
search form, sidebar, or parts within the sidebar such as social media
icons etc.) within a theme. I would put these files in a "partials" folder
inside my theme directory. Using `add_import_directory("partials")` in
functions.php would allow me to use `get_template_part('searchform')` to
use files in the partials directory.
This is different to the other ticket which is to do with child theme file
inheritance.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/30288#comment:3>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list