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 Answer 1

0

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? Nov 19, 2019 at 11:29
  • I tried Id but same issue. I think I am not able to display more then 6 widget. Nov 19, 2019 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 Nov 19, 2019 at 11:43
  • 1
    now working ?? may be issue is that you used capital characters in id. Nov 19, 2019 at 15:34
  • 1
    Yes, it's capital characters in id. Thanks for the help Aug 20, 2020 at 18:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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