How to display different parts of codes by using taxonomy?
-
Hi,
I’ve learned so much and solved a lot of problems from this forum, and now I got a problem taking me half a day but still got no answer.There are two parts A and B in my header.php, and I have a custom post type named new_categories in my functions.php file.
The posts in new_categories will load part A, otherwise it loads part B.
Here is the codes I tried, but it always loads A, is there anything I make mistake?<?php if ( $taxonomy_exists = taxonomy_exists(‘new_categories’) ):?>
<div> A </div>
<?php else:?>
<div> B </div>
<?php endif;?>Thank you for helping a wordpress beginner XD
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to display different parts of codes by using taxonomy?’ is closed to new replies.