Trying to limit hours displayed in WEEK VIEW

Home Forums Calendar Products Events Calendar PRO Trying to limit hours displayed in WEEK VIEW

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #1028209
    Alan
    Participant

    Hello,

    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

    #1028264
    Brian
    Member

    Hi,

    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

    #1028272
    Alan
    Participant

    Thanks 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!)

    #1028316
    Alan
    Participant

    Brian. 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…

    #1028634
    Brian
    Member

    Great, 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!

Viewing 5 posts - 1 through 5 (of 5 total)
  • The topic ‘Trying to limit hours displayed in WEEK VIEW’ is closed to new replies.