[wp-trac] [WordPress Trac] #23202: Enable is_page_template() within the Loop
WordPress Trac
noreply at wordpress.org
Fri Apr 25 20:31:18 UTC 2014
#23202: Enable is_page_template() within the Loop
------------------------------------+------------------------------
Reporter: wpsmith | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone: Awaiting Review
Component: Posts, Post Types | Version:
Severity: normal | Resolution:
Keywords: has-patch dev-feedback | Focuses: template
------------------------------------+------------------------------
Comment (by nacin):
Unless I'm reading this wrong, it seems like the issue here is the usage
of query_posts(). query_posts() does change the active $wp_query and thus
all conditionals.
This should work fine if you're on a page with a page template inside a
loop. But *the* loop doesn't really make any sense as that should be the
actual page (singular).
Alternatively, if it's proposing that it should work inside the loop for
the current page: I think this would break things by changing the return
value. While can take a function and make it work outside of the loop,
taking a function and changing its behavior inside the loop is gonna cause
problems.
Maybe I just don't understand the problem.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/23202#comment:4>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list