Update Nothing Found Notices

Home Forums Calendar Products Events Calendar PRO Update Nothing Found Notices

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #1193432
    Andrew
    Participant

    Hi,

    A while back, I found a snippet to place in my theme’s custom function.php file for changing the message shown when no events are available. I’ve included a screenshot for reference. This worked great, but my client now wants me to direct visitors that reach that message to another page in the site, specifically an event archive. They also asked to include a clickable link to a person’s email address. I can’t figure out how to accomplish this!

    Basically, a phrase like “You can also view information about recent and past WPCA events” needs to link to an archive page of past events. Any help would be greatly appreciated!

    #1193843
    Geoff
    Member

    Hi Andrew,

    Thanks for writing in!

    First off, I do want to note that we are a little limited in how much we can support custom development questions. That said, I’m absolutely happy to help as best I can!

    Here’s a snippet that, when tested, both modifies the text in the Past Event notice and adds a link to the calendar’s Past Events archive:

    add_filter( 'tribe_the_notices', 'customize_notice', 10, 2 );
    function customize_notice( $html, $notices ) {
    // If text is found in notice, then replace it
    if( stristr( $html, 'This event has passed.' ) ) {
    // Customize the message as needed
    $html = str_replace( 'This event has passed.', 'You can also view information about <a href="/events/past">recent and past WPCA events</a>.', $html );
    }

    Will this do the trick for you? Please let me know. 🙂

    Cheers!
    Geoff

    #1203895
    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 ‘Update Nothing Found Notices’ is closed to new replies.