The Events Calendar
[resolved] is_calendar() (3 posts)

  1. Jason Coleman
    Posted 4 years ago #

    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
    	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;
    			return true;

    Maybe something like this could be added to the plugin officially? Thanks.


  2. Rob La Gatta
    Modern Tribe Support
    Plugin Author

    Posted 4 years ago #

    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).

  3. Rob La Gatta
    Modern Tribe Support
    Plugin Author

    Posted 3 years ago #

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

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • The Events Calendar
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic