Support

Account

Home Forums Front-end Issues Displaying a category ID Reply To: Displaying a category ID

  • Seems like the $terms array is empty… You can test it with this code:

    
    <?php 
    
    $terms = get_the_terms( $post->ID, 'category' );  
    
    echo '<pre>';
    	print_r( $terms );
    echo '</pre>';
    die;
    
    ?>
    
    Can you confirm that 'category' is the correct taxonomy and $post->ID is the correct post ID?