Home › Forums › Calendar Products › Events Calendar PRO › Hide week days in calendar view?
- This topic has 11 replies, 2 voices, and was last updated 6 years, 11 months ago by Cath.
-
AuthorPosts
-
March 31, 2017 at 12:11 pm #1262783CathParticipant
Hi
I found this in the calendar shortcodes
‘Hide Weekends: set this to 1 and it will hide Saturdays and Sundays.[tribe_this_week hide_weekends=”true”]’
Is it possible to hide week days instead? All my events are at the weekend. What would I need to add to the shortcode?
Thank youApril 3, 2017 at 8:17 am #1263380VictorKeymasterHi Cath!
Thanks for reaching out! 🙂
Unfortunately, hiding week days is not something posible with a shortcode setting.
This is something you could post as an idea for a future implementation in our user voice here > https://tribe.uservoice.com/ so other users can vote for it.
Let me know if you have any other questions.
Best!
Victor
April 24, 2017 at 6:05 am #1273353CathParticipantHi
If it can’t be done with a shortcode can it be done any other way? All my events are at weekends and I am surely not alone in this. It looks ridiculous to have Monday ‘no events’, Tuesday ‘no events’ etcApril 24, 2017 at 10:19 am #1273537VictorKeymasterHi Cath!
Oh sure! I understand what you mean. Well I guess you could do that by customizing the week template files located in /wp-content/plugins/events-calendar-pro/src/views/pro/week/
You should check out our themer’s guide that will point you on how to customize our plugin’s template files. I hope this helps.
Cheers!
VictorApril 28, 2017 at 8:12 am #1275805CathParticipantThank you. Unfortunately when I get to wp-content/plugins/events-calendar-pro/src/views/pro/week/ I am unable to locate the correct bit to edit. Any tips what I am looking for?
April 28, 2017 at 10:33 pm #1276177VictorKeymasterHi Cath!
First off, I do want to note that we are fairly limited in how much we can support custom development questions like this.
That said, I’d be happy to at least point you in the right direction as best I can. We also have a list of freelancers who we would happily recommend for this level of help.
Having a deeper look at the code I found out the approach I gave you for customizing the template files is not ideal. Instead, you could try adding the following snippet of code into your theme’s functions.php file:
/**
* Events Calendar Pro
* Shows only weekends (Fri - Sat - Sun) in week view
*/
add_action('tribe_events_week_get_days','custom_tribe_events_week_get_only_weekends');
function custom_tribe_events_week_get_only_weekends($days){
foreach ( $days as $i => $day ) {
if ( $day > 0 && $day < 5 ) {
unset ( $days[ $i ] );
}
}
return $days;
}Bear in mind you should avoid setting “Week Starts On” other than weekend days, to prevent any PHP warning messages from showing.
Please let me know if it works for you.
Best!
VictorMay 5, 2017 at 5:18 am #1279093CathParticipantHi Thanks for this. I have added the snippet to the functions.php file but it hasn’t changed the view in the front end of the website. Is there something I need to do to change the calendar view?
May 5, 2017 at 9:38 am #1279364VictorKeymasterHey Cath!
That’s strange. Could you make sure you placed the code into your currently active theme’s functions.php file? If so, where exactly did you paste it? Could you send me a screenshot of it so I can see if there’s anything wrong with it?
Also, when coming back, could you please share with us your system info by following this guide > https://theeventscalendar.com/knowledgebase/sharing-sys-info/
Thanks,
VictorMay 5, 2017 at 12:03 pm #1279504CathParticipantThis reply is private.
May 5, 2017 at 1:58 pm #1279598VictorKeymasterThis reply is private.
May 27, 2017 at 9:35 am #1289905Support DroidKeymasterHey 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 ‘Hide week days in calendar view?’ is closed to new replies.