Home › Forums › Calendar Products › Events Calendar PRO › Month View title
- This topic has 9 replies, 3 voices, and was last updated 7 years, 7 months ago by
Mel.
-
AuthorPosts
-
August 27, 2018 at 12:33 pm #1606936
Mel
ParticipantHi,
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
MelAugust 29, 2018 at 6:00 am #1608657Jaime Marchwinski
KeymasterHi 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
August 30, 2018 at 8:27 pm #1610312Mel
ParticipantHi Jamie,
Thanks for the reply.
Q1: The code worked for a few things but NOT the month title?
Q2: You did not answer….
Thanks
MelAugust 31, 2018 at 4:23 am #1610491Barry
MemberHello, 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!
September 1, 2018 at 4:17 am #1611277Mel
ParticipantHi 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
MelSeptember 3, 2018 at 8:09 am #1612243Barry
MemberHi Mel – there sure is:
September 3, 2018 at 8:12 am #1612249Barry
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() ) )September 3, 2018 at 8:59 am #1612290Mel
ParticipantHi 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
MelSeptember 3, 2018 at 9:20 am #1612312Mel
ParticipantHi 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
MelSeptember 3, 2018 at 4:17 pm #1612599Barry
MemberGlad you figured it out 🙂
September 25, 2018 at 9:35 am #1630218Support Droid
KeymasterHey 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 -
AuthorPosts
- The topic ‘Month View title’ is closed to new replies.
