Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Last active December 11, 2015 17:28
Show Gist options
  • Save pdewouters/4634595 to your computer and use it in GitHub Desktop.
Save pdewouters/4634595 to your computer and use it in GitHub Desktop.
force Genesis layout for Tribe events month view
/**
* 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';
}
return $layout;
}
add_filter( 'genesis_pre_get_option_site_layout', 'ssm_force_layout' );
@pdewouters
Copy link
Author

thanks I"ll try that :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment