WordPress.org

Ready to get started?Download WordPress

Forums

conditionally remove sidebars in thesis (1 post)

  1. worldview
    Member
    Posted 2 years ago #

    Like a child and his father, I got "the talk" the other day from ECP concerning how its protocol overrides WP page format selections when Calendar or Events re used for page titles. Thus I have been looking for alternate ways to remove sidebar from calendar view. I found the code below at https://gist.github.com/2305130. It worked but then I had a site issue and now that everything is sort of back to normal I cannot get this code to work anymore.

    Any clue?

    // Conditionally remove original sidebars
    function no_sidebars() {
    
    	global $wp_query;
    	if('tribe_events' == get_post_type()) {
    
    		if ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && is_single() && !is_tax(TribeEvents::TAXONOMY) ) { // single event
    		    return true;
    		} elseif ( $wp_query->query_vars['eventDisplay'] == 'upcoming' || $wp_query->query_vars['eventDisplay'] == 'past' && $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && !is_tax(TribeEvents::TAXONOMY) ) { // list view
    			return true;
    		} elseif ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && $wp_query->query_vars['eventDisplay'] == 'month' && !is_tax(TribeEvents::TAXONOMY) ) { // grid view
    			return false;
    		} elseif ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && $wp_query->query_vars['eventDisplay'] == 'month' && is_tax(TribeEvents::TAXONOMY) ) { // grid view categories
    			return false;
    		} elseif ( $wp_query->query_vars['post_type'] == TribeEvents::POSTTYPE && tribe_is_day() ) { // single event days
    			return false;
    		}
    
    	} elseif( $wp_query->query_vars['post_type'] == TribeEvents::VENUE_POST_TYPE ) { // venues
    
    		return false;
    
    	} else {
    
    		return true;
    
    	}
    
    }
    add_filter('thesis_show_sidebars', 'no_sidebars');

Topic Closed

This topic has been closed to new replies.

About this Topic