Opened 15 years ago
Closed 15 years ago
#12958 closed enhancement (fixed)
locate_template restricts the use of get_template_part
Reported by: |
|
Owned by: | |
---|---|---|---|
Milestone: | 3.0 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Themes | Keywords: | |
Focuses: | Cc: |
Description
The locate_template functions utilizes require_once to include files. With get_generic_template providing the ability to simply include template files we should make it more flexible so users can include the same file twice from one template file.
For example if I wanted to create a custom template for a parent page with children and display the content from the children on the parent page I would use get_generic_template('loop','page') for the loop for the parent page, followed by another get_generic_template('loop','page') for each child page.
I suggest we replace the require_once function of locate_template with a require function to increase the administrators accessibility to template files.
Change History (6)
#1
@
15 years ago
- Summary changed from locate_template restricts the use of get_generic_template to locate_template restricts the use of get_template_part
#2
@
15 years ago
- Keywords reporter-feedback added
locate_template() doesn't do any including or requiring; it just finds the first available file and returns it's path. So I'm not sure what you're refering to.
#3
@
15 years ago
- Keywords reporter-feedback removed
- Milestone changed from Unassigned to 3.0
- Type changed from feature request to enhancement
It's actually load_template() that does the requiring. We could probably add a $once paramater to it.
Sorry, originally referenced get_generic_template when that function has been renamed to get_template_part.