<!-- column links -->
<div class="col-md-3 offset-md-2 links">
<?php if ( is_category( 'admission-event' ) ) { ?>
<a href="/" 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 -->
<!-- column links -->
<div class="col-md-3 offset-md-2 links">
<?php if ( is_category( 'admission-event' ) ) { ?>
<a href="https://www.eventbrite/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 -->
Share
Improve this question
asked Dec 2, 2019 at 3:19
AddyAddy
1
3
- Can use please try with in_category('admission-event') instead of is_category('admission-event'); – Gopala krishnan Commented Dec 2, 2019 at 10:15
- I’ll try that! Thank you so much for your help. It’s greatly appreciated – Addy Commented Dec 3, 2019 at 10:27
- Have you got solution for that? – Gopala krishnan Commented Dec 3, 2019 at 10:28
1 Answer
Reset to default 0is_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?