milohuang / reverie

Reverie is a versatile HTML5 responsive WordPress framework based on ZURB's Foundation.
http://theakiba.com/reverie/
MIT License
916 stars 196 forks source link

Feature Request: More widget areas #73

Closed NRG-R9T closed 11 years ago

NRG-R9T commented 12 years ago

I needed more widget areas than Sidebar and Footer for more flexibility and to use several plugins necessary.

In the "functions.php" file I copy paste the usefull code of the sidebar- and footer-widget to create a widget named "header" and BelowPost"

// create widget areas: sidebar, footer, header, BelowPost
$sidebars = array('Sidebar');
foreach ($sidebars as $sidebar) {
    register_sidebar(array('name'=> $sidebar,
        'before_widget' => '<article id="%1$s" class="row widget %2$s"><div class="sidebar-section twelve columns">',
        'after_widget' => '</div></article>',
        'before_title' => '<h6><strong>',
        'after_title' => '</strong></h6>'
    ));
}
$sidebars = array('Footer');
foreach ($sidebars as $sidebar) {
    register_sidebar(array('name'=> $sidebar,
        'before_widget' => '<article id="%1$s" class="four columns widget %2$s"><div class="footer-section">',
        'after_widget' => '</div></article>',
        'before_title' => '<h6><strong>',
        'after_title' => '</strong></h6>'
    ));
}
$sidebars = array('Header');
foreach ($sidebars as $sidebar) {
    register_sidebar(array('name'=> $sidebar,
        'before_widget' => '<article id="%1$s" class="row widget %2$s"><div class="header-section">',
        'after_widget' => '</div></article>',
        'before_title' => '<h6><strong>',
        'after_title' => '</strong></h6>'
    ));
}
$sidebars = array('BelowPost');
foreach ($sidebars as $sidebar) {
    register_sidebar(array('name'=> $sidebar,
        'before_widget' => '<article id="%1$s" class="eight columns widget %2$s"><div class="footer-section">',
        'after_widget' => '</div></article>',
        'before_title' => '<h6><strong>',
        'after_title' => '</strong></h6>'
    ));
}

and to call the Header-Widget this code-snippet I added to the "header.php" File after 'Start the main container'

<!-- Start the header widget @header.php after 'Start the main container' -->
    <div class="row">
            <?php /* Widgetized header */
            if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Header') ) : ?><?php endif; ?>
    </div>

the BelowPost-Widget I added this in "single.php" File just before

            <div class="row">
            <?php /* Widgetized content bar */
            if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('BelowPost') ) : ?><?php endif; ?>
            </div>

In my tests it worked fine. Will you add or change something specific? Also, I'm looking for more widgets (if somebody added and wants to share) or will share the snippets here, once It's needed.

milohuang commented 12 years ago

Thanks for the input. As a framework, I will not consider adding more widget area but will keep this post for folks who need.