Changing "Events for Month Name" to "Month Name" in Month View

Home Forums Calendar Products Events Calendar PRO Changing "Events for Month Name" to "Month Name" in Month View

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #1229085
    dmystudio
    Participant

    Hello,

    I’m trying to change the “Events for Month Name” heading to just “Month Name” in calendar month view – stripping out “Events for”

    Using the below function, I was able to strip out “Events,” but then I’m left with “for Month Name”… It of course, strips out ‘Events” in the dashboard as well, which isn’t what I want, but can live with…

    Seems like I’m very close?

    Any guidance would be greatly appreciated.

    Many thanks,

    Denise
    ___________________________

    function tribe_custom_theme_text ( $translation, $text, $domain ) {

    $custom_text = array(
    ‘Events’ => ”,
    );

    if( (strpos($domain, ‘tribe-‘) === 0 || strpos($domain, ‘the-events-‘) === 0 || strpos($domain, ‘event-‘) === 0) && array_key_exists($translation, $custom_text) ) {
    $translation = $custom_text[$translation];
    }
    return $translation;
    }
    add_filter(‘gettext’, ‘tribe_custom_theme_text’, 20, 3);

    • This topic was modified 9 years, 2 months ago by dmystudio.
    #1230254
    Barry
    Member

    Hi Denise 🙂

    Might something like this work for you?

    function custom_month_title( $title ) {
    	if ( ! tribe_is_month() || false === strpos( $title, 'Events for' ) ) {
    		return $title;
    	}
    
    	return str_replace( 'Events for', '', $title );
    }
    
    add_filter( 'tribe_get_events_title', 'custom_month_title' );

    It’s just a little more targeted and would be slightly more efficient as a consequence.

    #1231889
    dmystudio
    Participant

    Thank you thank you thank you! That was perfect and so simple!!

    #1232462
    Barry
    Member

    Excellent, happy to help 🙂

    I’ll go ahead and close this topic, but of course should anything else crop up please feel free to create a new one and one of the team will be only too happy to assist.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Changing "Events for Month Name" to "Month Name" in Month View’ is closed to new replies.