Skip to content

Instantly share code, notes, and snippets.

@sidharrell
Created July 31, 2014 00:30
Show Gist options
  • Select an option

  • Save sidharrell/f2007e6bf5dd7f7e67c8 to your computer and use it in GitHub Desktop.

Select an option

Save sidharrell/f2007e6bf5dd7f7e67c8 to your computer and use it in GitHub Desktop.
Make custom event table template only display one category
// In plugins/espresso-custom-templates/templates/events-table/index.php on line 20, change it to:
<pre><p class="category-filter" style="display:none"><label><?php echo __('Filter by category ', 'event_espresso'); ?></label></pre>
// and at line 91 insert the code:
if ( !empty( $event->category_id ) ) {
$array_cat=explode(",",$event->category_id);
if (array_search(1,$array_cat)===FALSE) continue;
$cat=array_map(function($val) { return "cat-" . trim($val); }, $array_cat);
$cat_class = implode(" ", $cat);
} else {
continue;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment