This topic has 2 replies, 2 voices, and was last updated 7 years, 1 months ago ago by Olga Barlow
Hi
I would like to replace the search bar with a widget area (for a replacement search function)
I can create the widget area in functions.php (with help from a blog)
function wpb_widgets_init() {
register_sidebar( array(
‘name’ => ‘Header Widget’,
‘id’ => ‘header-widget’,
‘before_widget’ => ‘<div class=”hw-widget”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h2 class=”hw-title”>’,
‘after_title’ => ‘</h2>’,
) );
}
add_action( ‘widgets_init’, ‘wpb_widgets_init’ );
and the following code in header.php should allow it to appear, but it is not showing.
<?php
if ( is_active_sidebar( ‘header-widget’ ) ) : ?>
<div id=”header-widget-area” class=”hw-widget widget-area” role=”complementary”>
<?php dynamic_sidebar( ‘header-widget’ ); ?>
</div>
<?php endif; ?>
But it isnt showing, please can you help?
f
Hello,
We are unable to provide support for customizations under our Support Policy. Anyway if you want to replace existing search by any other you need to edit header structure file depending on header type that you use, in your case, it is xstore/headers/center.php. Do all the changes in child theme files.
Regards
You must be logged in to reply to this topic.Log in/Sign up