I need change my theme on-fly (for mobile version I have different appearence), but widgets not saves correctly.
I tried configure widgets from theme, but this method doesn`t work.
if (!function_exists('sync_widgets_config')):
function sync_widgets_config() {
static $validConf = [
'orphaned_widgets_1' => [
0 => 'search-2',
1 => 'recent-posts-2',
2 => 'recent-comments-2',
3 => 'archives-2',
4 => 'categories-2',
5 => 'meta-2',
],
'wp_inactive_widgets' => [0 => 'gin-content-categories-2',],
'sliding_sidebar' => [
0 => 'gin-login-form-3',
1 => 'gin-account-cabinet-2',
2 => 'gin-content-top-menu-2',
],
'header_area' => [0 => 'gin-top-area-2',],
'pre_content' => [0 => 'gin-content-news-slider-2',],
'global_menu' => [0 => 'gin-content-categories-3'],
'footer' => [0 => 'gin-footer_widget-2',],
'global_footer' => [0 => 'gin-siteheart_widget-2',],
];
if ($validConf == wp_get_sidebars_widgets()) {
return;
}
wp_set_sidebars_widgets($validConf);
}
sync_widgets_config();
endif; // if (!function_exists('sync_widgets_config')):
Can you suggest method(or plugin) which configure my widgets for theme and after I change theme widgets will appear as I saved inside theme.
Aucun commentaire:
Enregistrer un commentaire