WordPress.org

Support

Support » Themes and Templates » Widget in div on Static "front" Page – Is it possible?

Widget in div on Static "front" Page – Is it possible?

  • I have a static page as a home page.
    Front – Main
    Posts – News

    I’d like to add a widget inside of a div on the main page. That way I can easily add a new video ect inside that div without having to open main.php and add updates there.

    Is there anyway I can do this without any plugins?

Viewing 1 replies (of 1 total)
  • In your functions.php register a dynamic sidebar area:

    register_sidebar( array(
    		'name' => 'Main Sidebar',
    		'id' => 'main-sidebar-1',
    		'description' => 'Here you can place widgets for the main page',
    		'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    		'after_widget' => "</aside>",
    		'before_title' => '<h3 class="widget-title">',
    		'after_title' => '</h3>',
    	) );

    This sidebar appears in the widgets admin page, now. You may add your widgets.

    In your main page template put a call to your new sidebar area dynamic_sidebar( 'main-sidebar-1' )

    Probably you need some additional DIV to get proper results.

Viewing 1 replies (of 1 total)
  • The topic ‘Widget in div on Static "front" Page – Is it possible?’ is closed to new replies.