• littlemissgeeke

    (@littlemissgeeke)


    Hi there!

    Please help! I’m trying to add a 3rd widget to the footer. I’ve copied and
    pasted the following code into the theme function in the functions php (found
    the code on another website):

    register_sidebar(
    array(
    ‘name’ => __( ‘Blog Sidebar’, ‘twentyseventeen’ ),
    ‘id’ => ‘sidebar-1’,
    ‘description’ => __( ‘Add widgets here to appear in your sidebar on blog
    posts and archive pages.’, ‘twentyseventeen’ ),
    ‘before_widget’ => ‘<section id=’%1$s’ class=’widget %2$s’>’,
    ‘after_widget’ => ‘</section>’,
    ‘before_title’ => ‘<h2 class=’widget-title’>’,
    ‘after_title’ => ‘</h2>’,
    )
    );

    register_sidebar(
    array(
    ‘name’ => __( ‘Footer 1’, ‘twentyseventeen’ ),
    ‘id’ => ‘sidebar-2’,
    ‘description’ => __( ‘Add widgets here to appear in your footer.’,
    ‘twentyseventeen’ ),
    ‘before_widget’ => ‘<section id=’%1$s’ class=’widget %2$s’>’,
    ‘after_widget’ => ‘</section>’,
    ‘before_title’ => ‘<h2 class=’widget-title’>’,
    ‘after_title’ => ‘</h2>’,
    )
    );

    register_sidebar(
    array(
    ‘name’ => __( ‘Footer 2’, ‘twentyseventeen’ ),
    ‘id’ => ‘sidebar-3’,
    ‘description’ => __( ‘Add widgets here to appear in your footer.’,
    ‘twentyseventeen’ ),
    ‘before_widget’ => ‘<section id=’%1$s’ class=’widget %2$s’>’,
    ‘after_widget’ => ‘</section>’,
    ‘before_title’ => ‘<h2 class=’widget-title’>’,
    ‘after_title’ => ‘</h2>’,
    )
    );

    register_sidebar(
    array(
    ‘name’ => __( ‘Footer 3’, ‘twentyseventeen’ ),
    ‘id’ => ‘sidebar-4’,
    ‘description’ => __( ‘Add widgets here to appear in your footer.’,
    ‘twentyseventeen’ ),
    ‘before_widget’ => ‘<section id=’%1$s’ class=’widget %2$s’>’,
    ‘after_widget’ => ‘</section>’,
    ‘before_title’ => ‘<h2 class=’widget-title’>’,
    ‘after_title’ => ‘</h2>’,
    )
    );

    This has added a 3rd footer widget as expected but it dosen’t actually function
    when I try to use it. What am I missing?

    Thanks in advance,

    Martine.

    The page I need help with: [log in to see the link]

Viewing 6 replies - 1 through 6 (of 6 total)
  • stilman davis

    (@stilman-davis)

    Are you using a child theme? It will make it easier to keep track of your changes, and ensure you don’t lose them with updates.

    Have you activated the new sidebars? Do they show up on the Appearance-widgets of the dashboard?

    I hope this helps start a solution.

    Thread Starter littlemissgeeke

    (@littlemissgeeke)

    Thanks for getting back to me!

    I’ve heard of a child theme but don’t know what it is or how to create one?

    My sidebars don’t seem to show up when I use them for some reason.

    stilman davis

    (@stilman-davis)

    There are a number of plugins to help create child themes. That will get you started.

    If you have changed any files in the orignal theme, I recommend putting them in the chiled reproducing the directory struture of the theme. So if you changed file X in directory Y you need to create a directory Y in the child theme and place your file X in it.

    There are a number of guides in the codex to help you with all of this, as well as help in any of the more discursive plugins.

    To get your new sidebars working you need to activate them

    For instance I have actovated twp mew areas wotj tjos cpde/

    if ( is_active_sidebar( 'sidebar-2' ) ||
    	 is_active_sidebar( 'sidebar-3' ) ) :
    ?>
    
    	<aside class="widget-area" role="complementary" aria-label="<?php esc_attr_e( 'Footer', 'twentyseventeen' ); ?>">
    		<?php
    		if ( is_active_sidebar( 'sidebar-2' ) ) { ?>
    			<div class="widget-column footer-widget-1">
    				<?php dynamic_sidebar( 'sidebar-2' ); ?>
    			</div>
    		<?php }
    		if ( is_active_sidebar( 'sidebar-3' ) ) { ?>
    			<div class="widget-column footer-widget-2">
    				<?php dynamic_sidebar( 'sidebar-3' ); ?>
    			</div>
    		<?php } ?>
    

    Of course you will have to sort out your own code and place it in the appropriate file in your child theme.

    I hope this will start you on your way.

    Thread Starter littlemissgeeke

    (@littlemissgeeke)

    Thanks for the info. I will try these things and see what happens. Thanks again ??

    you can try the Options for Twenty Seventeen Plugin. it’s not free, but it has done the job. i have now 4 footer widgets in use. but you can use also just 3. the plugin costs about 20,- British Pounds.

    Thread Starter littlemissgeeke

    (@littlemissgeeke)

    That’s awesome! Thank you ?? I will try that ??

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Adding 3rd footer widget’ is closed to new replies.