WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. strangerstudios
    Member
    Posted 2 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
    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.

    http://wordpress.org/extend/plugins/the-events-calendar/

  2. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 2 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. roblagatta
    Modern Tribe Support
    Plugin Author

    Posted 1 year 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

About this Topic