Created
July 31, 2014 00:30
-
-
Save sidharrell/f2007e6bf5dd7f7e67c8 to your computer and use it in GitHub Desktop.
Make custom event table template only display one category
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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