how to echo custom category from page category
-
Hi I’ve added category register_taxonomy on on the pages so that users can have different category to tick, but the problems is when i run a
if ( is_category( ‘well_done’ )) it doesnt pick that the page is categorythis is my code to register register_taxonomy
register_taxonomy('page_category', 'page', array( 'label' => 'Categories', 'hierarchical' => true, ));
and this is to echo based on the category on the page.php template
<?php if ( is_category( 'view_sample_menu_button' )) { echo "edy"; } elseif ( in_category( array( 'Tropical Birds', 'small-mammals' ) )) { echo "nope"; } else { // & c. } ?>
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘how to echo custom category from page category’ is closed to new replies.