WordPress.org

Ready to get started?Download WordPress

Forums

PHP: Need help with if terms are empty (1 post)

  1. thecorkboard
    Member
    Posted 2 years ago #

    Hey there-
    Only a PHP newb here :)

    I need to write something that basically says "if both the courses taxonomy and the extracurriculars taxonomy are not used on this post, tell the student 'you need to select some categories'".

    This is what I've tried but does not work:

    <?php
    	if( get_the_terms($post->ID, 'courses_tax') && get_the_terms($post->ID, 'extracurriculars_tax') == FALSE){
    	?>
    		<p>YOU HAVE NO CATEGORIES ASSOCIATED WITH THIS ARTIFACT</p>
    	<?php
    	}
    ?>

Topic Closed

This topic has been closed to new replies.

About this Topic