WordPress.org

Ready to get started?Download WordPress

Forums

WP Maintenance Mode
Loading dynamic sidebar in theme (2 posts)

  1. Bazze
    Member
    Posted 2 years ago #

    Hello!

    I'm trying to make a sidebar on the maintenance page and have done the following in my themes functions.php-file:

    if ( function_exists('register_sidebar') ){
    	register_sidebar(array(
    		'id' => 'maintenance-sidebar',
    		'name' => 'Maintenance sidebar',
            'before_widget' => '<div id="maintenance_sidebar">',
            'after_widget' => '</div>',
            'before_title' => '',
            'after_title' => '',
    	));
    }

    Then I added the following to site.php in the wp-maintenance-mode plugin folder:
    <?php if (!function_exists('dynamic_sidebar') || !dynamic_sidebar('maintenance-sidebar')) { echo "<!-- error -->"; } ?>

    To me this should work (the sidebar appears in the Widgets admin page and it's fully possible to drag widgets to it), but all I get is the <!-- error --> printed out. HOW CAN THIS BE? Is it something that doesn't get loaded when you're in the plugin vs. when you implement it in an ordinary theme? Please help! I'm clueless.

    http://wordpress.org/extend/plugins/wp-maintenance-mode/

  2. Bazze
    Member
    Posted 2 years ago #

    No one has any idea how to solve this in a neat way?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic