Categories in list view, main event page as calendar view

Home Forums Calendar Products Events Calendar PRO Categories in list view, main event page as calendar view

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #335495
    Lawrence Hirsch
    Participant

    I tried this tutorial with current version of Events Pro and it won’t work for me. Has something changed?

    https://theeventscalendar.com/support/documentation/display-categories-in-list-view/

    #336379
    Lawrence Hirsch
    Participant

    I have tried disabling all other plugins, but still can’t get this to work. I tried the function addition to my child functions and alternatively to the theme, but neither work.

    #352938

    Hi:

    Thanks for reaching out to us and I’m sorry to hear you are having trouble with the tutorial. I quickly added the code snippet to my test site and I am seeing that Categories are now displayed in the “List” view instead of the “Month” view.

    If it is not a hassled can you re-confirm that the code snippet is not working.

    1. Place the code in your current theme’s functions.php file
      (functions.php of active theme)
    2. Event Settings : Default View property is set to “Month”
    3. Viewing the calendar ../events/ shows the Month View
    4. Go to a Category page …/events/category/category-name it should redirect to ../events/category/category-name/upcoming/

    Also to make trouble shooting easier can you confirm for me the name of your active theme?  will let me know we are putting the code in the correct location.

    Thanks in advance for your help,

    – Matthew

    #380284
    Lawrence Hirsch
    Participant

    Sure, here;’s the code:

    /**
    * Forcing Categories to display in List View in The Events Calendar
    */
    add_action(‘parse_query’, ‘use_list_view_for_categories’, 60);

    function use_list_view_for_categories($query) {
    // Run once
    remove_action(‘parse_query’, ‘use_list_view_for_categories’, 60);

    // Interfere only for non-ajax Tribe category requests not already destined to be presented by list view
    if (defined(‘DOING_AJAX’) && DOING_AJAX) return;
    if (!isset($query->tribe_is_event_category) || !$query->tribe_is_event_category) return;
    if (tribe_is_view(‘upcoming’)) return;

    // Obtain the query term and get a link to list view for that term
    $main_tax_query = $query->tax_query->queries[0];
    $term = get_term_by(‘slug’, $main_tax_query[‘terms’][0], TribeEvents::TAXONOMY);
    $link = tribe_get_listview_link($term->term_id);

    // Try to redirect
    wp_redirect($link);
    exit();
    }

    Default is set to month view.
    tried in current theme’s functions (as well as child theme)
    ../events/ shows the Month View.
    category page …/events/category/upcoming/ ; this is still showing as month

    #380361
    Lawrence Hirsch
    Participant

    The active theme name is Santorini Resort v1.3 (CSS igniter). I also tested the function in TwentyThirteen and same result for me.

    #399019

    Hi!

    I wanted to let you know that I am working on this. I ran the snippet against the Twenty Thirteen theme using your code and it doesn’t work due to left and right single quotes. I’m not sure how those got into your version of the code. Please copy the code directly from this gist and retry. I’ve copied it directly from my Twenty Thirteen theme that behaves as outlined in the tutorial while using version 3.6.1 of our plugins.

    I hope this resolves the issue! If not please make sure to disable all other plugins and re-check.

    Thanks for your patience resolving this issue.

    – Matthew

    #579112

    Hi, I wanted to quickly follow-up with you to see if you are all set or if you have further questions. Please let me know if you do have additional questions I can assist with or if I should go ahead and close this thread.

    Thank you,

    – Matthew

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘Categories in list view, main event page as calendar view’ is closed to new replies.