• Resolved 2minacdev

    (@thysgc)


    I “inherited” a site from a previous developer (I am not much more than an amateur myself) that uses 2 themes (by means of the Multiple Themes Plugin): Storefront (the sidebar works fine in it) and a custom-made theme that has no sidebars built in.
    I need the sidebar only in Storefront, but the other one needs to be the main theme. Whenever I switch the active theme to it (which is absolutely necessary), the sidebar disappears.
    Obviously that is because your plugin can’t find the sidebar function in the active theme and there is nothing to replace.
    Is there any way around this?
    Thank you

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Joachim Jensen

    (@intoxstudio)

    Thank you for reporting this.

    Is the problem that the sidebar is displayed fine in Storefront at first, but when the Multiple Themes plugin switches to another theme (and back), the widgets have been removed from the sidebar?

    Thread Starter 2minacdev

    (@thysgc)

    Yes, that is exactly what happens.

    Thread Starter 2minacdev

    (@thysgc)

    Any ideas about how to fix this? Thx

    Plugin Author Joachim Jensen

    (@intoxstudio)

    I think what you can do is in your custom theme to register a sidebar with the same name as the one in the Storefront theme.

    In functions.php in your custom theme, add this:

    
    add_action('widgets_init', 'custom_theme_register_sidebar');
    function custom_theme_register_sidebar()
    {
    	register_sidebar(array(
    		'name'        => 'Sidebar',
    		'id'          => 'sidebar-1',
    		'description' => '',
    	));
    }
    

    It will not display the sidebar anywhere, but it should prevent WordPress from removing widgets on theme switch.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Theme without sidebar’ is closed to new replies.