Home › Forums › Calendar Products › Events Calendar PRO › Trying to limit hours displayed in WEEK VIEW
- This topic has 4 replies, 2 voices, and was last updated 10 years, 4 months ago by
Brian.
-
AuthorPosts
-
November 19, 2015 at 12:13 pm #1028209
Alan
ParticipantHello,
I am writing this because I actually found the answer to this about 2 months ago when I initially setup my site, but for some reason the “fix” no longer works.
I am needing to remove the full 24 hours from the week view. As it displays now, people see the day activities for the week at 12am and have to scroll down quite a bit to see the activities at 9am.
I used this script before in my header file and it worked a couple months ago:
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;
}Now this code no longer works. All days in week view start at 12 am… is there any solution to this that will “stick”? I have hunted this forum for help with this, but I seem to be the only one with this issue… any help is appreciated, thank you
November 19, 2015 at 2:25 pm #1028264Brian
MemberHi,
Thanks for using our plugins. I can help out here.
I tested the coding and it is working for me.
Where did you place the coding?
Also are all the apostrophes should be straight with no curls or it could cause an issue.
Let me know and we can work on this from here.
Thanks
November 19, 2015 at 2:36 pm #1028272Alan
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!)
November 19, 2015 at 4:46 pm #1028316Alan
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…
November 20, 2015 at 6:18 am #1028634Brian
MemberGreat, glad it helps, I am going to go ahead and close this ticket, but if you need help on this or something else please post a new ticket.
Thanks!
-
AuthorPosts
- The topic ‘Trying to limit hours displayed in WEEK VIEW’ is closed to new replies.
