Multiple header widget
-
Hi,
How do you do.
I’m using “Twenty Nineteen” template(Latest version of WordPress). I added a new “Header widget” that is working perfect.
I need another Header widget. The problem is that: When I duplicate codes in Function.php (with different Id and Name), my back-end and front-end goes white page.
The question: How can I have more than 1 header,footer or sidebar widget in widget area?
*Even I’ve used some plugin (like: Custom Sidebars or Widget Option) but there isn’t any controly where the put my content.
___________________________
EXTRA INFORMATION
I used this code to create first extra “Header Widget”:Added this code to Function.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' ); <strong>Added this code to Header.php:</strong> <?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; ?> ___________________________
I asked this question after three days wasted time. ??
Sincerely
Mendez
- The topic ‘Multiple header widget’ is closed to new replies.