Hide week days in calendar view?

Home Forums Calendar Products Events Calendar PRO Hide week days in calendar view?

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #1262783
    Cath
    Participant

    Hi
    I found this in the calendar shortcodes
    ‘Hide Weekends: set this to 1 and it will hide Saturdays and Sundays.

    [tribe_this_week hide_weekends=”true”]’

    Is it possible to hide week days instead? All my events are at the weekend. What would I need to add to the shortcode?
    Thank you

    #1263380
    Victor
    Keymaster

    Hi Cath!

    Thanks for reaching out! 🙂

    Unfortunately, hiding week days is not something posible with a shortcode setting.

    This is something you could post as an idea for a future implementation in our user voice here > https://tribe.uservoice.com/ so other users can vote for it.

    Let me know if you have any other questions.

    Best!

    Victor

    #1273353
    Cath
    Participant

    Hi
    If it can’t be done with a shortcode can it be done any other way? All my events are at weekends and I am surely not alone in this. It looks ridiculous to have Monday ‘no events’, Tuesday ‘no events’ etc

    #1273537
    Victor
    Keymaster

    Hi Cath!

    Oh sure! I understand what you mean. Well I guess you could do that by customizing the week template files located in /wp-content/plugins/events-calendar-pro/src/views/pro/week/

    You should check out our themer’s guide that will point you on how to customize our plugin’s template files. I hope this helps.

    Cheers!
    Victor

    #1275805
    Cath
    Participant

    Thank you. Unfortunately when I get to wp-content/plugins/events-calendar-pro/src/views/pro/week/ I am unable to locate the correct bit to edit. Any tips what I am looking for?

    #1276177
    Victor
    Keymaster

    Hi Cath!

    First off, I do want to note that we are fairly limited in how much we can support custom development questions like this.

    That said, I’d be happy to at least point you in the right direction as best I can. We also have a list of freelancers who we would happily recommend for this level of help.

    Having a deeper look at the code I found out the approach I gave you for customizing the template files is not ideal. Instead, you could try adding the following snippet of code into your theme’s functions.php file:

    /**
    * Events Calendar Pro
    * Shows only weekends (Fri - Sat - Sun) in week view
    */
    add_action('tribe_events_week_get_days','custom_tribe_events_week_get_only_weekends');
    function custom_tribe_events_week_get_only_weekends($days){
    foreach ( $days as $i => $day ) {
    if ( $day > 0 && $day < 5 ) {
    unset ( $days[ $i ] );
    }
    }
    return $days;
    }

    Bear in mind you should avoid setting “Week Starts On” other than weekend days, to prevent any PHP warning messages from showing.

    Please let me know if it works for you.

    Best!
    Victor

    #1279093
    Cath
    Participant

    Hi Thanks for this. I have added the snippet to the functions.php file but it hasn’t changed the view in the front end of the website. Is there something I need to do to change the calendar view?

    #1279364
    Victor
    Keymaster

    Hey Cath!

    That’s strange. Could you make sure you placed the code into your currently active theme’s functions.php file? If so, where exactly did you paste it? Could you send me a screenshot of it so I can see if there’s anything wrong with it?

    Also, when coming back, could you please share with us your system info by following this guide > https://theeventscalendar.com/knowledgebase/sharing-sys-info/

    Thanks,
    Victor

    #1279504
    Cath
    Participant

    This reply is private.

    #1279598
    Victor
    Keymaster

    This reply is private.

    #1289905
    Support Droid
    Keymaster

    Hey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.

    Thanks so much!
    The Events Calendar Support Team

Viewing 11 posts - 1 through 11 (of 11 total)
  • The topic ‘Hide week days in calendar view?’ is closed to new replies.