Ejemplo n.º 1
0
function reactor_register_sidebars()
{
    $sidebars = get_theme_support('reactor-sidebars');
    if (!is_array($sidebars[0])) {
        return;
    }
    if (in_array('primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Primary Sidebar', 'reactor'), 'id' => 'sidebar', 'description' => 'The primary sidebar for 2 column layouts', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Secondary Sidebar', 'reactor'), 'id' => 'sidebar-2', 'description' => 'The secondary sidebar for 3 column layouts', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Primary', 'reactor'), 'id' => 'sidebar-frontpage', 'description' => 'Primary sidebar for the front page template', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Secondary', 'reactor'), 'id' => 'sidebar-frontpage-2', 'description' => 'Secondary sidebar for the front page template', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('footer', $sidebars[0])) {
        $footer = '<div id="%1$s" class="widget top-bar-widget ';
        $footer .= 'large-' . reactor_get_widget_columns('sidebar-footer');
        $footer .= ' columns %2$s">';
        register_sidebar(array('name' => __('Footer', 'reactor'), 'id' => 'sidebar-footer', 'description' => 'Footer widget area', 'class' => '', 'before_widget' => $footer, 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
}
Ejemplo n.º 2
0
function reactor_register_sidebars()
{
    $sidebars = get_theme_support('reactor-sidebars');
    if (!is_array($sidebars[0])) {
        return;
    }
    if (in_array('primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Primary Sidebar', 'reactor'), 'id' => 'sidebar', 'description' => 'Barra esquerra a les pàgines normals (excepte pàgines de categories)', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Secondary Sidebar', 'reactor'), 'id' => 'sidebar-2', 'description' => 'Barra dreta a les pàgines normals (excepte pàgines de categories)', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-primary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Primary', 'reactor'), 'id' => 'sidebar-frontpage', 'description' => 'Barra esquerra a la Portada', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('front-secondary', $sidebars[0])) {
        register_sidebar(array('name' => __('Front Page Secondary', 'reactor'), 'id' => 'sidebar-frontpage-2', 'description' => 'Barra dreta a la Portada', 'class' => '', 'before_widget' => '<div id="%1$s" class="widget frontpage-widget %2$s">', 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
    if (in_array('footer', $sidebars[0])) {
        $footer = '<div id="%1$s" class="widget top-bar-widget ';
        $footer .= 'large-' . reactor_get_widget_columns('sidebar-footer');
        $footer .= ' columns %2$s">';
        register_sidebar(array('name' => __('Peu', 'reactor'), 'id' => 'sidebar-footer', 'description' => 'Peu de pàgina', 'class' => '', 'before_widget' => $footer, 'after_widget' => '</div>', 'before_title' => '<h4 class="widget-title">', 'after_title' => '</h4>'));
    }
}