The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Widget in div on Static "front" Page - Is it possible? (2 posts)

  1. keysuuh
    Posted 3 years ago #

    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?

  2. JochenT
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.