Count to how many categories a post belongs to olatechproMarch 31, 20233 Views Is there a possibility to count to how many categories a post belongs to? Post Views: 3 Related postsGet rid of this Strict Standards warningWooCommerce: get_current_screen not working with multi languageCan’t login on WordPressForce HTTPS using .htaccess – stuck in redirect loopWordPress: Ajax not working to insert, query and result dataHow Can I pass an image file to wp_handle_upload?
Use get_the_terms() and count the resulting array: print count( get_the_terms( $post->ID, 'category' ) ) . ' categories'; Log in to Reply
Use
get_the_terms()
and count the resulting array: