Home>Support>Focus – Registering Sidebars

Focus – Registering Sidebars

Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].

I registered sidebars

function me_widgets_init() {
 
	register_sidebar( array(
		'name' => 'Events Page Sidebar',
		'id' => 'eventspage_sidebar',
		'before_widget' => '',
		'after_widget' => '',
		'before_title' => '<h1 class="widget-title">',
		'after_title' => '</h1>',
	) );

        register_sidebar( array(
		'name' => 'Events Page Footer',
		'id' => 'eventspagefoot_sidebar',
		'before_widget' => '',
		'after_widget' => '',
		'before_title' => '<h1 class="widget-title">',
		'after_title' => '</h1>',
	) );
}
add_action( 'widgets_init', 'me_widgets_init' );

But when I go to the page, the sidebar LOOKS different than other pages.
I’m guessing that I need to put something here:

		'before_widget' => '',
		'after_widget' => '',

I notice inspecting the source that all other pages using the normal sidebar have
<aside id=

But I’m not sure how to dynamically do this when registering a sidebar in FOCUS PRO.

Can you explain to me how to MANUALLY register 2 new sidebars for FOCUS PRO (a sidebar and a footer widget area)

URL: http://localhost

This is our free support forum. Replies can take several days. If you need fast email support, please purchase a SiteOrigin Premium license.

  1. 10 years, 7 months ago Andrew Misplon
    Hi, I Work Here

    Hi Brix

    If you check the parent theme’s functions.php file you’ll see the original widget areas being created. I’m pasting them below. Use the arguments you need and add them to your widget areas:

    /**
     * Register widgetized area and update sidebar with default widgets
     *
     * @since focus 1.0
     */
    function focus_widgets_init() {
    	register_sidebar( array(
    		'name' => __( 'Post Sidebar', 'focus' ),
    		'id' => 'sidebar-post',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h1 class="widget-title">',
    		'after_title' => '</h1>',
    	) );
    
    	register_sidebar( array(
    		'name' => __( 'Page Sidebar', 'focus' ),
    		'id' => 'sidebar-page',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h1 class="widget-title">',
    		'after_title' => '</h1>',
    	) );
    
    	register_sidebar( array(
    		'name' => __( 'Footer Widgets', 'focus' ),
    		'id' => 'sidebar-footer',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => '</aside>',
    		'before_title' => '<h1 class="widget-title">',
    		'after_title' => '</h1>',
    	) );
    }
    add_action( 'widgets_init', 'focus_widgets_init' );
    

    Hope that helps.

Replies on this thread are closed. Please create a new thread if you have a question, or purchase a SiteOrigin Premium license if you need one-on-one email support.

Get The Most Out of SiteOrigin with SiteOrigin Premium

Find Out More