• Need to add 3 columns of widgets to the footer in my child-theme for Toolbox theme. Should work like it’s been done in Twentyeleven with 3 footer widget boxes in the admin area.

    Have tried a few solutions offered here in the forum, they all suggest something similar to:
    https://wordpress.org/support/topic/adding-widgets-to-toolbox-theme-as-a-child-theme

    All of them break – that is, if they don’t break the site entirely, the footer vanishes completely as soon as I add a widget to the box in the admin area. They also don’t create more than one widget box in the admin area. The closest I’ve come to anything that works is just by copy-pasting the relevant code from twentyeleven into my child-theme like so:

    child-theme functions.php

    <?php
    register_sidebar( array(
    'name' => __( 'Footer Area One', 'toolbox' ),
    'id' => 'sidebar-3',
    'description' => __( 'An optional widget area for your site footer', 'toolbox' ),
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget' => "</aside>",
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );

    register_sidebar( array(
    'name' => __( 'Footer Area Two', 'toolbox' ),
    'id' => 'sidebar-4',
    'description' => __( 'An optional widget area for your site footer', 'toolbox' ),
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget' => "</aside>",
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );

    register_sidebar( array(
    'name' => __( 'Footer Area Three', 'toolbox' ),
    'id' => 'sidebar-5',
    'description' => __( 'An optional widget area for your site footer', 'toolbox' ),
    'before_widget' => '<aside id="%1$s" class="widget %2$s">',
    'after_widget' => "</aside>",
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );
    ?>

    In child-theme footer.php (just after the opening <footer id="colophon" role="contentinfo"> tag):

    <?php
    if ( ! is_404() )
    get_sidebar( 'footer' );
    ?>

    And then I copied the sidebar-footer.php file over from twentyeleven completely, changing any code referencing ‘twentyeleven’ to ‘toolbox’.

    The page loads, the Widgets section of the admin panel shows three footer boxes just like it should, but as soon as I drop a widget in any of the footer boxes – boom, the whole footer (including credits/copyright) just vanishes completely.

    Any suggestions greatly welcome!

Viewing 7 replies - 1 through 7 (of 7 total)
  • try

    <div style="float:left; width:250px;">
    <?php if (!dynamic_sidebar('Footer Area One')) : ?>
    <aside id="%1$s" class="widget %2$s">
    <h3><?php _e('An optional widget area for your site footer', 'toolbox');?></h3>
    <?php _e('some text '); ?>
    </aside>
    <?php endif; ?>
    
    </div>
    <div style="float:left; width:250px;">
    <?php if (!dynamic_sidebar('Footer Area Two')) : ?>
    <aside id="%1$s" class="widget %2$s">
    <h3><?php _e('An optional widget area for your site footer', 'toolbox');?></h3>
    <?php _e('some text '); ?>
    <?php endif; ?>
    
    </div>
    <div style="float:left; width:250px;">
    <?php if (!dynamic_sidebar('Footer Area Three')) : ?>
    <aside id="%1$s" class="widget %2$s">
    <h3><?php _e('An optional widget area for your site footer', 'toolbox');?></h3>
    <?php _e('some text '); ?>
    <?php endif; ?>

    </div>

    Thread Starter CiderJack

    (@ciderjack)

    Thanks Robin! This works great – had been hoping to get the same sort of functionality as twentyeleven, i.e. when one (or all) isn’t being used they disappear and the others fill in the difference automatically without having to tinker with the code. (The particular client this is for is rather fickle (and code illiterate) and wants to be able to change things themselves, hence using wordpress to give them this ability via the admin section. They’ll likely want to move widgets around every so often without having to come back to me to make a 5-minute adjustment to the code – which I’d rather avoid too.)

    However, this works! Much better than everything I’d been trying. Enough so that I’ll go with it unless someone else can provide a more flexible solution.

    yup you can do that there is a trick to it
    add a blank text widget 😉 should work if their is blank text widget it wont show up as such
    make sense ?

    Thread Starter CiderJack

    (@ciderjack)

    Ah yes, I see, but that only works to a certain extent. The others don’t change width to fill up the space, like they do with twentyeleven, the others fill in the difference automatically.

    it should be functions
    i havnt worked to extensively with widgets otherwise would have given you a quick solutions
    might look over the weekend though

    waheed

    (@waheed_imran)

    i need wordpress responsive theme nav menu HOME sample page at right side
    any body have idea

    Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Waheed_imran, create your own thread on your own issue.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘[Theme: Toolbox] Add three-column widgets to footer like twentyeleven’ is closed to new replies.