is_category, is_single, is_page not working in function.php

I have category named “magazine” and I create some article of this category. this is the link of my article http://www.example.com/magazine/article-one/ I want to check in function.php if I’m in this category or not, for that I use if(is_category('magazine')){die('I am in magazine category');} but I got nothing. I tried by using is_single and is_page but all this function not working.

Read more here: is_category, is_single, is_page not working in function.php

Leave a Reply

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