WordPress question – is this right to detect the main feed?

if ( is_feed() && !( is_archive() || is_singular() ) ) { ... }

Comments

2 responses to “”

  1. Matthias Pfefferle Avatar

    What about:

    if ( is_feed() && is_home()) { ... }

    The is_singular() checks the site is a single post or page.

    1. Peter Wilson Avatar
      Peter Wilson

      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

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.