Display DIV if tag exists for event

Home Forums Calendar Products Events Calendar PRO Display DIV if tag exists for event

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1562442
    Pat Lee
    Participant

    How do I accomplish this in my child template for Event Calendar Pro? In event list view, I’d like to display a DIV if the particular event contains a specific tag. For example “APPLE”

    <?php // If string “APPLE” appears exists as a tag for this event then…. ?>
    <div>Content goes here</div>
    <?php endif;?>

    #1562945
    Sky
    Keymaster

    Hi Pat!

    Thanks for reaching out! I’d be happy to help with your question.

    To check for a tag on an event, you can use the has_tag() function.

    So, in your example, the code would look like so:


    <?php if( has_tag('APPLE') ): ?>
    <div>Content goes here</div>
    <?php endif;?>

    Hope that helps! Please let us know if you have any other questions.

    Thanks,
    Sky

    #1579239
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Display DIV if tag exists for event’ is closed to new replies.