Viewing 6 replies - 1 through 6 (of 6 total)
  • Hi,

    Using a child theme shouldn’t make any difference. This tutorial explains how to create custom templates that are upgrade-safe:
    https://wp-events-plugin.com/documentation/using-template-files/

    Thread Starter filz51

    (@filz51)

    I copied the template ical.php to
    html/wp-content/themes/mytheme-child/plugins/events-manager/templates/

    I put these lines into ical.php

    /* Get the category ID */
    $uri=$_SERVER['REQUEST_URI'];
    $args=explode('/',$uri);
    /* handling different permalinks */
    if ($args[1]=='index.php') {
    	$start_index_URI=2;
    }else{
    	$start_index_URI=1;
    }
    /* retrieve category ID from WP Events Manager DB */
    if($args[$start_index_URI]=='events' && $args[$start_index_URI + 1]=='categories') {
    	$cat_name=$args[$start_index_URI + 2];
    	$cat_obj=get_term_by('name', $cat_name , 'event-categories');
    	$cat_id=$cat_obj->term_id;
    }

    And I replaced the former line 13 with
    $EM_Events = EM_Events::get(apply_filters('em_calendar_template_args',array( 'limit'=>get_option('dbem_ical_limit'), 'owner'=>false, 'orderby'=>'event_start_date', 'scope' => get_option('dbem_ical_scope'), 'category'=>$cat_id )) );

    When I call https://example.com/events/categories/categoryname/events.ics I get an ical- feed with all events, instead of the events of that category. Do I call the wrong adress then?

    I am interested in the answer to this. I have not made the changes but would like to be assured that this approach will still work…

    Thank you!

    It should still work fine.

    @filz51 – Any luck getting this to work. I am trying to accomplish the same thing and I stuck.

    Thread Starter filz51

    (@filz51)

    @Tomjob – No, I let it be but if you find the clue, please tell here.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘ical-feed for every event category’ is closed to new replies.