Last active
December 11, 2015 17:28
-
-
Save pdewouters/4634595 to your computer and use it in GitHub Desktop.
force Genesis layout for Tribe events month view
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'; | |
} | |
return $layout; | |
} | |
add_filter( 'genesis_pre_get_option_site_layout', 'ssm_force_layout' ); |
thanks I"ll try that :)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The next time you got the problem that you don't know a filter name, simply dump the name of all filters below the footer (code not tested, typos may be present).