Month View title

Home Forums Calendar Products Events Calendar PRO Month View title

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1606936
    Mel
    Participant

    Hi,

    I need to make some changes to the Month title now that the recent update displays it….

    I don’t understand why making changes to the Month view title is not part of the settings? There are so many users that request this? Come on guys… I should be able to go settings/display and fill in the text for the month title!!

    Q1: how do I change the text of the title?

    Q2: See attached pic. How do I reduce the spacing above and below the title? I really would like the title between the prev/next buttons?

    Thanks
    Mel

    #1608657

    Hi Mel,

    Thanks so much for reaching out!

    You can change the Month View Title using the snippet provided in the following article:

    https://theeventscalendar.com/knowledgebase/change-the-wording-of-any-bit-of-text-or-string/

    Let me know if that helps!

     

    Thanks,

    Jaime

     

    #1610312
    Mel
    Participant

    Hi Jamie,

    Thanks for the reply.

    Q1: The code worked for a few things but NOT the month title?

    Q2: You did not answer….

    Thanks
    Mel

    #1610491
    Barry
    Member

    Hello, Mel!

    Q1: The code worked for a few things but NOT the month title?

    Sorry to hear that.

    add_filter( 'tribe_get_events_title', function( $title ) {
        if ( ! tribe_is_month() ) {
            return $title;
        }
    
        return 'MY CUSTOM MONTH VIEW TITLE';
    } );

    Perhaps a snippet like the one provided above would help/serve as a starting point?

    This could be added either to a custom plugin (preferred) or else to your theme’s functions.php file.

    Q2: See attached pic. How do I reduce the spacing above and below the title? I really would like the title between the prev/next buttons?

    Sorry we missed this first time round (though, as a rule of thumb, it’s best to stick to one question per topic 🙂 ).

    There are a few possibilities, but a straightforward CSS-based solution might look something like this:

    #tribe-events {
    	position: relative;
    	top: -50px;
    }
    
    .tribe-events-page-title {
    	position: relative;
    	top: 50px;
    }

    You could try adding this via the theme customizer (Appearance ‣ Customize ‣ Additional CSS), though note it’s just a starting point and makes a few assumptions such as month view being the only active view – which seems to be the case on your site, but of course is something that might change later.

    I hope those are useful to you!

    #1611277
    Mel
    Participant

    Hi Barry,

    Thanks for the reply! The spacing css worked perfect 🙂

    I added the snippet for the month title and it works for the string that is returned. But I need to
    have it return the current month as the string…. is there a function I can use for that?

    Thanks
    Mel

    #1612243
    Barry
    Member

    Hi Mel – there sure is:

    tribe_get_month_view_date()

    #1612249
    Barry
    Member

    …To give an example of how The Events Calendar itself works with that, this is a small piece of the default month title code:

    date_i18n( 
        tribe_get_date_option( 'monthAndYearFormat', 'F Y' ), 
        strtotime( tribe_get_month_view_date() ) 
    )
    #1612290
    Mel
    Participant

    Hi Barry,

    I am not a coder so how would I fit all this together?

    add_filter( ‘tribe_get_events_title’, function( $title ) {
    if ( ! tribe_is_month() ) {
    return $title;
    }

    return ‘MY CUSTOM MONTH VIEW TITLE’; ??
    } );

    and

    date_i18n(
    tribe_get_date_option( ‘monthAndYearFormat’, ‘F Y’ ),
    strtotime( tribe_get_month_view_date() )
    )

    to make the month title display the current month?

    Thanks
    Mel

    #1612312
    Mel
    Participant

    Hi Barry,

    This is what I did to make it work:

    add_filter( ‘tribe_get_events_title’, function( $title ) {
    if ( ! tribe_is_month() ) {
    return $title;
    }

    return date_i18n(
    tribe_get_date_option( ‘monthAndYearFormat’, ‘F Y’ ),
    strtotime( tribe_get_month_view_date() )
    );
    } );

    Thanks
    Mel

    #1612599
    Barry
    Member

    Glad you figured it out 🙂

    #1630218
    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 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Month View title’ is closed to new replies.