• Hello.

    I have some issues to add a widgetzone as my footer.
    There are tons of tuto on the web but nothing helped:

    I have a website with a theme child from thirteen theme.
    I have modified the functions.php from parent theme (so the thirteen) and added some code:

    register_sidebar(array(
            'name' => 'footer_widget',
            'before_widget' => '<div class="footer_widget">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>',
        ));

    To function twentythirteen_widgets_init() {

    Normaly, that would be enough to see a change in the backoffice… but nothing.

    So i have added this in my footer.php:

    <div id="footer_widget">
     <?php    if ( !function_exists( 'dynamic_sidebar' ) || !dynamic_sidebar('footer_widget') ) ?>
    </div>

    And nothing… what did i do wrong.
    Thanks for your help.

Viewing 5 replies - 1 through 5 (of 5 total)
  • I have modified the functions.php from parent theme (so the thirteen) and added some code:

    Why are you editing the parent’s files? You should be making your changes to your child theme’s functions.php file.

    Thread Starter Kins

    (@kins)

    when i made that (change child) i have errors and my website doesnt work anymore…

    But perhaps i made it wrong.

    If you use “twentythirteen_widgets_init() {” in a functions.php in your child theme, it doesnt work… what should i do?

    You need to create a new function in your child theme to add the new sidebar.

    Thread Starter Kins

    (@kins)

    hum, yeah.
    And how do i do that? (a tuto perhaps?)
    And after… where i must declare this function?

    Thread Starter Kins

    (@kins)

    <?php
    remove_action( 'widgets_init', 'twentythirteen_widgets_init' ); //necessary to replace parent theme's code
    function twentyten_child_widgets_init() {
    register_sidebar( array(
    'name' => __( 'Alt Primary Widget Area', 'twentyten' ),
    'id' => 'alt-primary-widget-area',
    'description' => __( 'Alt primary widget area', 'twentyten' ),
    'before_widget' => '<li id="%1$s" class="widget-container %2$s">',
    'after_widget' => '',
    'before_title' => '<h3 class="widget-title">',
    'after_title' => '</h3>',
    ) );
    }
    /** Register sidebars by running twentyten_child_widgets_init() on the widgets_init hook. */
    add_action( 'widgets_init', 'twentyten_child_widgets_init' );

    [Moderator Note: Please post code & markup between backticks (not single quotes) or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

    In fonctions.php (child)
    It seems to work… i’ll make tries and see Thanks for your help

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Add a widget zone as footer’ is closed to new replies.