I have an archive page that is listing a custom taxonomy. Under each listing, there are some buttons that were hardcoded into the template page that have call to actions associated with them. One of them I need removed or not to display, based on a specific custom taxonomy term. My thought was to hide it using CSS based on that fact. This is the code I used but it is not working.
<?php
$supplier_list = wp_get_post_terms($post->ID, 'supplier', array("fields" =>"names"));
//Starting if condition
if (in_array("tax1",$supplier_list)==0) {
?>
<p class="hide"></p>
<?php
} //End of IF condition
?>
<a href="<?php echo get_post_meta($post->ID, 'ecpt_tds', true); ?>">Download Button</a>
I need to hide the "Download Button" when the term for the listing is "tax1" which is in the taxonomy "supplier". I think it may be an if/else statement that needs to be here and I am not sure the condition is correct because it is showing the <p class="hide">
on all the listings, not just those in the tax1. Any help is appreciated.