Skip to content

Instantly share code, notes, and snippets.

@Pebblo
Created May 18, 2020 15:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Pebblo/36e25d7c662a6f4c9a2e09a219e66fe4 to your computer and use it in GitHub Desktop.
Save Pebblo/36e25d7c662a6f4c9a2e09a219e66fe4 to your computer and use it in GitHub Desktop.
How to force Porto theme to load a specific layout and sidebar for EE events.
<?php // Do not include the opening PHP tag if you already have one.
// Force Porto theme to load the 'right-sidebar' layout and 'home-sidebar'.
add_filter('porto_meta_layout', 'tw_ee_filter_porto_meta_layout', 10, 1);
function tw_ee_filter_porto_meta_layout( $settings ) {
if( is_singular('espresso_events') ) {
$settings[0] = 'right-sidebar';
// Change this to the slug of the sidebar you want to load.
$settings[1] = 'home-sidebar';
}
return $settings;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment