Forcing list view on mobile (only)

Home Forums Calendar Products Events Calendar PRO Forcing list view on mobile (only)

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #963978
    crharrison
    Participant

    My clients love the monthly view of The Events Calendar on laptops & desktops, but it displays terribly on phones. In an earlier forum post, I found a solution but do not know how to implement it. I want to force display of the list view on mobile only. Can you give me very specific instruction about what to do and where to do it? Even the programmer I work with couldn’t figure out where to put the following, which was a solution I found in a forum:

    Truth Seeker
    Posts: 15
    Topics: 17
    Andrea September 1, 2014 Permalink

    Is there an option to have the default view set to View as Calendar for all devices, except for mobile view? The List view on my iPhone looks great but client wants calendar view on desktop. Thanks! PS: Site under construction at http://www.celestialbirth.com/newsite
    Bearded
    Support Ginger
    Posts: 90

    Josh September 2, 2014 Permalink

    Hey Andrea,

    Thanks for reaching out to us!

    You should be able to accomplish the desired effect by using the “wp_is_mobile()” conditional to check whether the current visitor is viewing from a mobile device. If so, you could then redirect the user to the List view by using the following function “tribe_get_listview_link”

    An example of what this might look like would be:

    if( wp_is_mobile() ) {
    wp_safe_redirect( tribe_get_listview_link() );
    }

    Let me know if this helps.

    #964243
    Brian
    Keymaster

    Hi,

    Thanks for using our plugins.

    I looked around and we do not have instructions on how to do this nor is it a feature our plugin so I am limited in supporting it, but can try some things.

    I was able to play around with this coding and got it to work:

    https://gist.github.com/jesseeproductions/fc21ce52314f31dc230b

    Add that to your theme’s functions.php.

    Let me know how that works out.

    Thanks

    #973747
    Brian
    Keymaster

    Since I haven’t heard back from you here, I’m going to go ahead and close out this thread. Feel free to start a new thread if you have further issues. Thanks! 🙂

Viewing 3 posts - 1 through 3 (of 3 total)
  • The topic ‘Forcing list view on mobile (only)’ is closed to new replies.