Forum Replies Created
-
AuthorPosts
-
Alan
ParticipantBrian. You’re the level headed friend I never had. I completely skimmed over your comment about the apostrophes n- that was the issue the whole time… Thank you so much, sorry for the dumb question…
Alan
ParticipantThanks for that Brian, I’ve tried using the code in a variety of places actually. I am currently using it in the header.php file that I am calling from the primary events-calendar theme file.
I tried adding the code to the functions.php file, but that showed no improvement. I tried added it to a content.php file I created for my child theme in a folder /child-theme/tribe-events/week/ directory and that didn’t work.
Any suggestions? (thanks again for the reply!)
October 25, 2015 at 6:31 pm in reply to: Removing a certain number of hours every day from the week view #1017752Alan
ParticipantHi Angelo,
I just found the answer to this one – hope it helps!
You can add this code to the header of your page and it will limit the hours shown in week view to 9am – 7pm
===
<?php
add_filter( ‘tribe_events_week_get_hours’, ‘filter_week_hours’ );
function filter_week_hours( $hours ) {
$hour = 0;foreach ( $hours as $key => $formatted_hour ) {
if ( $hour < 9 || $hour > 19 ) {
unset( $hours[ $hour ] );
}$hour ++;
}return $hours;
}
?>====
If you want to modify the hours, just change the “if ( $hour < 9 || $hour > 19 ) {” line to be whatever time you want (in 24 hour format so 7pm here is “19”)
Hope that makes sense…
Alan
ParticipantHi George,
Thank you very much for your help. Thanks to your approach I was able to resolve the issue.
I created a template file for Events that called a specific header file that uses a hard-coded header graphic for the header area. This allowed me to keep the positioning of my nav area and display the full calendar month view – thank you so much!
-
AuthorPosts
