Support » Theme: Twenty Twenty » SIDEBAR WANTED!

  • I just want to express a wish for sidebar in twenty twenty theme. Say “me too” or “yes” or something similar for supporting this initiative. Many thanks to all, folks, developers of 2020 especially!

    • This topic was modified 6 months, 1 week ago by wprat.
Viewing 3 replies - 1 through 3 (of 3 total)
  • I second that.

    Or if it is possible through costumisation through a child theme, please point me in the right direction!

    Thank You in advance!

    Jan

    I added a sidebar in header to add a slider. Not sure this is the right way, but this is what I did:
    just copied header.php from parent theme to child-theme and I made this changes:

    @@ -179,8 +179,10 @@
    get_template_part( ‘template-parts/modal-search’ );
    }
    ?>
    + <!– Barra dinamica in cui includo lo slider –>
    </header><!– #site-header –>

    + <?php if ( !function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘header_sidebar’) ) : endif; ?>
    <?php
    // Output the menu modal.
    get_template_part( ‘template-parts/modal-menu’ );

    Then, in child-theme functions.php I wrote:

    function header_widgets_init() {
    register_sidebar( array(
    ‘name’ => ‘Header Sidebar’,
    ‘id’ => ‘header_sidebar’,
    ‘before_widget’ => ‘<aside class=”widget %2$s”>’,
    ‘after_widget’ => ‘</aside>’,
    ‘before_title’ => ‘<h2 class=”widget-title”>’,
    ‘after_title’ => ‘</h2>’,
    ) );
    }
    add_action( ‘widgets_init’, ‘header_widgets_init’ );

    Interesting solution @mociofiletto – I will have a look at that 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.