Alan

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • in reply to: Trying to limit hours displayed in WEEK VIEW #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…

    in reply to: Trying to limit hours displayed in WEEK VIEW #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!)

    Alan
    Participant

    Hi 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…

    in reply to: Adding full month calendar view to WordPress Page #1016072
    Alan
    Participant

    Hi 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!

Viewing 4 posts - 1 through 4 (of 4 total)