Changing CSS on Event title if event is sold out

Home Forums Ticket Products Event Tickets Plus Changing CSS on Event title if event is sold out

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1211708
    revolution
    Participant

    I am looking to change the color of the text on the event in the month view if the event if sold out, I was wondering if anyone has experience doing this.

    #1211715
    Geoff
    Member

    Hello @revolution,

    Great question! While I have not come across an answer for this myself, I bet you could accomplish it using the tribe_events_has_soldout function:

    https://theeventscalendar.com/function/tribe_events_has_soldout/

    It would likely be something where you wrap the page title in that function and, based on the output, specifying a classname to create the effect.

    For demonstration purposes:

    <?php if tribe_events_has_soldout() {
    the_title( '<h1 class="tribe-events-single-event-title-soldout">', '</h1>' );
    } else {
    the_title( '<h1 class="tribe-events-single-event-title">', '</h1>' );
    } ?>

    I haven’t tested this at all, but I’m hoping it gives you something to play with. You can see how adding a new classname of tribe-events-single-event-title-soldout would then allow you to write CSS in your theme’s style.css file to modify the appearance of the title.

    Cheers!
    Geoff

    #1213364
    revolution
    Participant

    Awesome thank you very much for your help!

    #1213397
    Geoff
    Member

    My pleasure! Glad to hear it worked well!

    I’ll go ahead and close this thread but let us know if any other questions come up and we’d be happy to help. 🙂

    Cheers!
    Geoff

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Changing CSS on Event title if event is sold out’ is closed to new replies.