Queries are only available after “wp” action hook, so ‘init’ is too early to check for it.

Leave a Reply

Your email address will not be published.