I believe you are looking for is_tax()
and not has_term()
. has_term()
just basically checks if a post belongs to a given term, while is_tax()
on the otherhand checks whether or not you are on a taxonomy archive page.
So, you can change this code
if ( !has_term('juice', 'types' ) ):
to
if ( !is_tax( 'types', 'juice' ) ):
This simply means that if the current taxonomy archive page is not of the term juice
, do something