Forum Replies Created

Viewing 3 replies - 1 through 3 (of 3 total)
  • Thread Starter wayahead

    (@wayahead)

    Oh my goodness, thank you so much!
    Im not sure what I was missing but the code you just supplied made it all work.
    Thank you very much for your help!

    Thread Starter wayahead

    (@wayahead)

    I have tried deactivating all the plugins except wpstaging and the child theme plugin.

    Does it matter where in the functions.php or header.php file I place the code?
    In functions I have just placed it at the end and in the header I placed it here –
    `<?php
    wp_body_open();
    ?>
    <?php get_sidebar ( ‘sidebar-utility’ ); ?>

    <header id=”site-header” class=”header-footer-group” role=”banner”>

    I assume it is in the right place in the header.php as it does put a sidebar there just not the right one…

    thanks again for your help

    Thread Starter wayahead

    (@wayahead)

    Hi,
    Thanks for answering.
    To the best of my knowledge i have followed the instructions on that page.
    I am using a child theme.
    Code on functions.php is-
    function twentytwenty_widgets_init() {
    register_sidebar( array(
    ‘name’ => __( ‘utility’, ‘twentytwenty’ ),
    ‘id’ => ‘utility’,
    ‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    ) );
    }
    add_action( ‘widgets_init’, ‘my_register_sidebars’ );
    function my_register_sidebars() {
    /* Register the ‘utility’ sidebar. */
    register_sidebar(
    array(
    ‘id’ => ‘utility’,
    ‘name’ => __( ‘utility’ ),
    ‘description’ => __( ‘above header’ ),
    ‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
    ‘after_widget’ => ‘</div>’,
    ‘before_title’ => ‘<h3 class=”widget-title”>’,
    ‘after_title’ => ‘</h3>’,
    )
    );

    }
    Code on header.php –
    <?php get_sidebar ( ‘utility’ ); ?>

    Code on sidebar-utility.php –
    <div id=”utility” class=”sidebar”>
    <?php dynamic_sidebar( ‘utility’ ); ?>
    </div>

    Thanks so much,
    Leanne

Viewing 3 replies - 1 through 3 (of 3 total)