Created
May 18, 2020 15:06
-
-
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.
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
<?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