Thesis / using is_category in custom_functions not working
-
Hi all,
I’m trying to target single posts within a certain category. In those single posts within that category, I want to display additional info, which works.
My problem is that I can’t target that specific category; the additional info displays on all single posts. I’m sure my category id = 3. Here’s what I have:
/* adding transcript and sponsor custom fields */ function additional_post_info() { if ( is_category('3') ) { ?> <div class="additionalPostInfo"> <h3>Transcript</h3> <div class="transcript"> <?php the_field('interview_transcript'); ?> </div> <div class="sponsors"> <h3>Sponsors</h3> <?php the_field('interview_sponsors'); ?> </div> </div><!-- additionalPostInfo --> <?php } } add_action('thesis_hook_after_post','additional_post_info');
I’ve also tried
if ( is_category('3') && is_single() )
which also is not working.
Any ideas?
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Thesis / using is_category in custom_functions not working’ is closed to new replies.