-
-
Save brianjking/5e529779629d80b77a2d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Forces full width content layout on Tribe events calendar or list view | |
* Uses $wpquery query_vars to determine template | |
* | |
* @param $layout | |
* | |
* @return string | |
*/ | |
function ssm_force_layout($layout){ | |
if(is_admin()) | |
return; | |
global $wp_query; | |
if( 'tribe_events' === $wp_query->query_vars['post_type'] | |
&& ! empty( $wp_query->query_vars['eventDisplay'] ) | |
&& ( 'upcoming' === $wp_query->query_vars['eventDisplay'] || 'month' === $wp_query->query_vars['eventDisplay'] ) | |
) { //Events or Venue Pages | |
$layout = 'full-width-content'; | |
remove_action( 'genesis_sidebar', 'genesis_do_sidebar' ); | |
remove_action( 'genesis_sidebar_alt', 'genesis_do_sidebar_alt' ); | |
remove_action( 'genesis_after_post_content', 'genesis_post_meta' ); | |
remove_action( 'genesis_before_post_content', 'genesis_post_info' ); | |
} | |
return $layout; | |
} | |
add_filter( 'genesis_site_layout', 'ssm_force_layout' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment