0

<!-- 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 -->


3
  • Can use please try with in_category('admission-event') instead of is_category('admission-event'); Dec 2, 2019 at 10:15
  • I’ll try that! Thank you so much for your help. It’s greatly appreciated
    – Addy
    Dec 3, 2019 at 10:27
  • Have you got solution for that? Dec 3, 2019 at 10:28

1 Answer 1

0

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?

1
  • Thank you so much!
    – Addy
    Dec 3, 2019 at 10:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.