• Resolved Jason Coleman

    (@strangerstudios)


    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)
  • This is awesome. Thanks a lot for sharing! Let me run it by the team to see if anyone thinks there’d be problems with incorporating; if not, I’ll have them work it into a future release (probably 2.1 or later at this point).

    Just a heads up that we’ve got a variation on this coming in the 3.0 build in early 2013. Thanks again!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: The Events Calendar] is_calendar()’ is closed to new replies.