Call custom header based on custom taxonomy term?
-
Hi folks,
I’d like to load a custom header onsingle.php
based on whether the post contains a custom taxonomy term or not.
I’ve tried this, but it’s not working:$terms = get_the_terms( $post->ID, 'custom-taxonomy' ); if ( has_term( 'custom-taxonomy-term' )) { get_header('header-custom'); } else { get_header(); }
I’ve been googling like crazy and trying so many variations but I’m stuck.
Any help much appreciated? Thank you!
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Call custom header based on custom taxonomy term?’ is closed to new replies.