WordPress question – is this right to detect the main feed?
if ( is_feed() && !( is_archive() || is_singular() ) ) { ... }
Written by
in Notes.
WordPress question – is this right to detect the main feed?
if ( is_feed() && !( is_archive() || is_singular() ) ) { ... }
What about:
if ( is_feed() && is_home()) { ... }
The is_singular()
checks the site is a single post or page.
Unfortunately is_home
is false in the main feed, thus the not check. Ticket #20899 exists but hasn’t gone anywhere, I suspect a fix risks breaking a few sites.
Leave a Reply