[Plugin: The Events Calendar] is_calendar()
-
Maybe the plugin included a way to do this, but I needed to check if I was on a “calendar page” to adjust styles, etc. I whipped up this function based on code in TribeEventsTemplates::templateChooser($template):
//is_calendar() like function for the-events-calendar if(!function_exists("is_calendar")) { function is_calendar() { // no non-events need apply if ( get_query_var( 'post_type' ) != TribeEvents::POSTTYPE && ! is_tax( TribeEvents::TAXONOMY ) && get_query_var( 'post_type' ) != TribeEvents::VENUE_POST_TYPE ) { return false; } else return true; } }
Maybe something like this could be added to the plugin officially? Thanks.
https://www.ads-software.com/extend/plugins/the-events-calendar/
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘[Plugin: The Events Calendar] is_calendar()’ is closed to new replies.