Home › Forums › Calendar Products › Events Calendar PRO › Change height in calendar weekly view
- This topic has 7 replies, 2 voices, and was last updated 8 years, 1 month ago by
Jennifer.
-
AuthorPosts
-
March 10, 2018 at 1:42 pm #1475669
Alex
ParticipantHi, is it possible to change the size of the weekly view? Currently it displays 8h, but I would like to define that the calendar shows e.g. 12h without the need for scrolling.
Thanks
AlexMarch 11, 2018 at 11:29 pm #1476180Jennifer
KeymasterHi Alex,
You can change the size and remove the scrolling by either adding some custom CSS or doing a template override (our themer’s guide has instructions on this, and this post should help get you started).
We are a bit limited in the amount of support that we can provide for customizations, but if you get stuck or have any questions, please let me know – I’ll be happy to point you in the right direction!
Thanks,
Jennifer
March 14, 2018 at 8:54 am #1478988Alex
ParticipantHi Jennifer, thanks for your comment. I followed the instructions, but the post you were referencing to removes the scrolling and shows the entire day (24h), which also looks quite odd. I would like to have e.g. only my opening times displayed from 7am to 9pm in the weekly view. Is this possible?
Thanks
AlexMarch 14, 2018 at 3:18 pm #1479528Jennifer
KeymasterHi Alex,
Thanks for clarifying what you’re looking for…I believe this snippet will do the trick:
// Limit the week view hours
function tribe_limit_week_view_hours($hours) {
foreach ($hours as $hour => $formatted) {
if ($hour >= 7 && $hour <= 21) {
$limited_hours[$hour]=$formatted;
}
}
return $limited_hours;
}
add_filter('tribe_events_week_get_hours', 'tribe_limit_week_view_hours');Can you try adding that to the functions.php file of your child theme and let me know if it works for you?
March 20, 2018 at 8:05 am #1483919Alex
ParticipantHi Jennifer, thanks for the peace of code. I added it to the functions.php of the theme and run into an error message on my page.”Parse error: syntax error, unexpected ‘=’, expecting ‘)’ in “path…./wp-content/themes/Avada/functions.php on line 819” The line is where I added the code. After removing it, the page worked fine again.
An idea?
Best regards,
AlexMarch 21, 2018 at 4:50 pm #1485510Jennifer
KeymasterHi Alex,
I’m sorry that you’re running into an error…I just tested this again on my end, but it’s working for me. Can you double check that the quotes copied over correctly? Sometimes they can be changed from straight quotes to curly quotes when copying code from the forums, which can result in errors.
March 22, 2018 at 5:42 am #1485793Alex
ParticipantHi Jennifer, I don’t know where the issue was, but I copied another functions.php pasted your code into it and know it works, exactly as I was hoping.
Thanks a lot for your support and patience 🙂
Best regards,
AlexMarch 22, 2018 at 8:45 am #1485943Jennifer
KeymasterAwesome! It’s possible that a character was deleted somewhere the first time around, which can be a bit difficult to spot. Regardless, I’m glad that it’s working now!
I’ll go ahead and close out this thread, but if you run into any other issues, feel free to open up a new thread 🙂
-
AuthorPosts
- The topic ‘Change height in calendar weekly view’ is closed to new replies.
