Last active
March 24, 2021 07:43
-
-
Save thecodepoetry/822895548f7701f4086a to your computer and use it in GitHub Desktop.
To change default pre selected sidebar position in The7 and Armada
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
function dt_change_default_sidebar() { | |
global $DT_META_BOXES; | |
if ( $DT_META_BOXES ) { | |
if ( isset($DT_META_BOXES[ 'dt_page_box-sidebar' ]) ) { | |
$DT_META_BOXES[ 'dt_page_box-sidebar' ]['fields'][0]['std'] = 'left'; // use disabled to disable sidebar | |
} | |
} | |
} | |
add_action( 'admin_init', 'dt_change_default_sidebar', 20 ); | |
Update (Cotober 2020): You can now use the preset settings, please refer to | |
https://support.dream-theme.com/knowledgebase/change-default-sidebar-position/ |
does anyone have a solution to make the default disabled? Tried editing the filter and did not work out
You're a genius!!! Thank you.
add_filter( 'presscore_main_container_classes', 'apyc_sidebar_default_left', 1 );
function apyc_sidebar_default_left($classes) {
return isset($classes[0]) ? $classes[0] = 'sidebar-left':$classes;
}
You saved my day, Thank you.
This is an old hack, You can now use the built-in preset settings to change default sidebar postion, please refer to documentation
https://support.dream-theme.com/knowledgebase/change-default-sidebar-position/
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it is not working!