In category.php, how would I test against a category having a parent category?
If the parent category is A, and the sub-category is B, and the user loads the URL for category B, I would like to be able to test if it has parent A, and run code if it does.
I've found the get_category_parents tag, but it seems to return a link list rather than an array:
get_category_parents($cat, TRUE, ', '));
Even if I got the array, I'm not sure what the php function is to test against it (php noob).
Thanks!
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…