Possible to use conditionals within add_feed() callback?

You can only use conditional tags after the posts_selection action hook has run.

According to the codex article on add_feed it should be called with the init action, which runs before. Now I don’t know when and how you run it, because you don’t say so in the above example, but I’d assume you do it before posts_selection – that would explain your dilemma anyway.

Leave a Comment