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