widget in header
-
I have made a Custom Header Widget for https://heritagecountrypottery.com/.
How do I make it the same width as the rest of my site?
The code I used is belowfunctions.php
function wpb_widgets_init() {
?
????register_sidebar( array(
????????‘name’????????? => ‘Custom Header Widget Area’,
????????‘id’??????????? => ‘custom-header-widget’,
????????‘before_widget’ => ‘<div class=”chw-widget”>’,
????????‘after_widget’? => ‘</div>’,
????????‘before_title’? => ‘<h2 class=”chw-title”>’,
????????‘after_title’?? => ‘</h2>’,
????) );
?
}
add_action( ‘widgets_init’, ‘wpb_widgets_init’ );=========================================================================
header.php
<?php
?
if ( is_active_sidebar( ‘custom-header-widget’ ) ) : ?>
????<div id=”header-widget-area” class=”chw-widget-area widget-area” role=”complementary”>
????<?php dynamic_sidebar( ‘custom-header-widget’ ); ?>
????</div>
?????
<?php endif; ?>The page I need help with: [log in to see the link]
- The topic ‘widget in header’ is closed to new replies.