Skip to content

Instantly share code, notes, and snippets.

@pdewouters
Last active December 11, 2015 17:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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' );
@franz-josef-kaiser
Copy link

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).

/** Plugin Name: _Dump Filters */
// Skip gettext filters
add_action( 'all', 'dump_filters' );
function dump_filters()
{
    static $names = array();
    if ( 'gettext' === current_filter() )
        return;

    if ( 'shutdown' === current_filter() )
        return printf( 
             '<pre>%s</pre>'
            ,join( '\n', $names )
        );

    $names[] = current_filter();
}

@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