<!-- column links -->
<div class="col-md-3 offset-md-2 links">
<?php if ( is_category( 'admission-event' ) ) { ?>
<a href="https://www.eventbrite.com/d/ut--salt-lake-city/vocalocity/" title="<?php the_title();?>" class="btn btn-secondary tickets" <?php echo $open_new_window; ?>>BUY TICKETS</a>
<a href="<?php echo $post_link ?>" title="<?php the_title();?>" class="btn btn-secondary more-info" <?php echo $open_new_window; ?>>MORE INFO<i class="fa fa-angle-right"></i> </a>
<?php } else { ?>
<a href="<?php echo $post_link ?>" title="<?php the_title();?>" class="btn btn-secondary more-info" <?php echo $open_new_window; ?>>MORE INFO<i class="fa fa-angle-right"></i> </a>
<?php } ?>
</div>
<!-- /column links -->
-
Can use please try with in_category('admission-event') instead of is_category('admission-event');– Gopala krishnanDec 2, 2019 at 10:15
-
I’ll try that! Thank you so much for your help. It’s greatly appreciated– AddyDec 3, 2019 at 10:27
-
Have you got solution for that?– Gopala krishnanDec 3, 2019 at 10:28
1 Answer
is_category()
is the wrong function to use here. That category is checking Are we on the archive page for the given category?
The correct function to use would be has_category()
, which is checking Is this post in the given category?