[wp-trac] [WordPress Trac] #34487: Add a new conditional tag for the "Posts Page"
WordPress Trac
noreply at wordpress.org
Thu Oct 29 19:22:46 UTC 2015
#34487: Add a new conditional tag for the "Posts Page"
-------------------------+-----------------------------
Reporter: roytanck | Owner:
Type: enhancement | Status: new
Priority: normal | Milestone: Awaiting Review
Component: General | Version: trunk
Severity: normal | Keywords:
Focuses: |
-------------------------+-----------------------------
Currently, there's no conditional tag to determine whether the current
page is the "Posts Page", set under Settings->Reading. The codex
(https://codex.wordpress.org/Conditional_Tags#The_Blog_Page) describes a
way to combine is_home() and is_front_page(), but I propose that we
instead add a new conditional tag to deal with this.
Naming the function is a little tricky. Unfortunately, the name
"is_posts_page" is taken in query.php, so I created a patch that adds
"is_blog_page". It returns true on the "posts page", and false everywhere
else.
I've run across this issue in real world projects a couple of times and
though it would be a good addition to WordPress. The patch adds this to
query.php because is_home() and is_front_page also live there.
--
Ticket URL: <https://core.trac.wordpress.org/ticket/34487>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform
More information about the wp-trac
mailing list