0

I am getting one issue on my WordPress theme.

Your theme has 2 other widget areas, but this particular page doesn’t display them. You can navigate to other pages on your site while using the Customizer to view and edit the widgets displayed on those pages.

I have a total number of 8 widgets on my widgets page and I added Wordpress search widgets in the universal search widgets but it's not displaying.

enter image description here

Then I checked Appearance-> Customizeon but It's displaying only 6.

enter image description here

Would you help me out how to solve this issue? I tried to check on google but I haven't found the solution.

I am using below code

/*universal search */
function universalSearch() {
    register_sidebar( array(
        'name'          => 'Universal Search',
        'id'            => 'universalSearchField',
        'before_widget' => '<div class="chw-widget">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="chw-title">',
        'after_title'   => '</h2>',
    ) );

}
add_action( 'widgets_init', 'universalSearch' );

function universalSearch1() {
    register_sidebar( array(
        'name'          => 'Universal Search1',
        'id'            => 'universalSearch1',
        'before_widget' => '<div class="chw-newsletter">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="chw-newsletter_title">',
        'after_title'   => '</h2>',
    ) );

}
add_action( 'widgets_init', 'universalSearch1' );

Displaying on page

<?php if ( is_active_sidebar('universalSearchField')) : 
        dynamic_sidebar('universalSearchField');
        endif; ?>
-1

Change Id of register sidebar. i have tested and after changing id it is working fine. let me know if this solve you issue.

function universalSearch() {
    register_sidebar( array(
        'name'          => 'Universal Search',
        'id'            => 'universal-search-field',
        'before_widget' => '<div class="chw-widget">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="chw-title">',
        'after_title'   => '</h2>',
    ) );

     register_sidebar( array(
        'name'          => 'Universal Search1',
        'id'            => 'universal-search-field-1',
        'before_widget' => '<div class="chw-newsletter">',
        'after_widget'  => '</div>',
        'before_title'  => '<h2 class="chw-newsletter_title">',
        'after_title'   => '</h2>',
    ) );
}
add_action( 'widgets_init', 'universalSearch' );

Displaying on page

if ( is_active_sidebar('universal-search-field')) : 
    dynamic_sidebar('universal-search-field');
endif;

if ( is_active_sidebar('universal-search-field-1')) : 
    dynamic_sidebar('universal-search-field-1');
endif;
9
  • May I know why this answer got downvote? – Naren Verma Nov 19 '19 at 11:29
  • I tried Id but same issue. I think I am not able to display more then 6 widget. – Naren Verma Nov 19 '19 at 11:29
  • did you use these sidebar in particular page which you Appearance-> customize ? because if you use sidebar in that page then only it will display in Appearance-> customize – Chetan Vaghela Nov 19 '19 at 11:43
  • I am trying to display on header.php and footer.php both page but it's not displaying. Event I am also using the ID name – Naren Verma Nov 19 '19 at 11:45
  • did you saved widget after change id ? check here is there a search form in Appearance-> widgets prnt.sc/pz11zf ? i have checked place code in header.php and footer.php and it is working – Chetan Vaghela Nov 19 '19 at 11:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.