I'm not an educated programmer, but usually i can put existing code together so it works the way i want it to. But this time i'm lost, i feel like i've tried everything.
I'm trying to only show a template part if the product is part of a specific term. This is one of the numerous code snippets i've tried.
I hope it makes sense to what i'm trying if not i'll answer any questions :)
$taxonomy = taxonomy_exists( 'produkttype' );
if ( $term = 'pude' && $term = 'senge' ) {
echo get_template_part( 'partials/sections/section', 'trustpilot' );
}
get_the_terms()
function instead oftaxonomy_exists()
. In your code you only check if the term has been defined, not if it is assigned/associated to the post. Look at accepted answer in this question.