Sidebars generating a 1 after HTML
-
Hello all,
Hoping I’m using the right sub-forum.
I am developing a theme and I have 2 sidebars, both doing the same thing. I haven’t completed the styling yet, so if you go visit, the primary sidebar will be at the bottom left, and the second sidebar I am using to hold the search bar.
You will notice that there is a “1” under each one, not contained in any tag or anything. Just a random 1, and for the life of me I cannot figure out where it’s coming from.
I’ve checked the register_sidebar and get_sidebar documentation to see if there is a setting I am not turning off. I’ve also searched the vastness of the internet, but I guess I’m not wording my search parameters correctly.
Here is the relevant functions.php code:
function american_cyanide_sidebar() { register_sidebar( array( 'name' => esc_html__( 'Primary Sidebar', 'american-cyanide' ), 'id' => 'sidebar-primary', 'descritpion' => esc_html__( 'Widgets added here will appear on the side of the home page.' ), 'before_widget' => '<section id="%1s" class="widget %2s">', 'after_widget' => '</section>', 'before_title' => '<h2 class="sidebar-widget-title">', 'after_title' => '</h2>', ) ); register_sidebar(array( 'name' => esc_html__( 'Search Sidebar', 'american-cyanide' ), 'id' => 'sidebar-search', 'description' => esc_html__( 'Space for the Search Widget.' ), 'before_widget' => '<section id="%1s" class="widget %2s">', 'after_widget' => '</section>', 'before_title' => '<h6 class="search-bar-title">', 'after_title' => '</h6>', ));
And here is the code from primary and search php files, respectively:
<?php if ( is_active_sidebar( 'sidebar-primary' ) ) { ?> <ul class="sidebar"> <?= dynamic_sidebar( 'sidebar-primary' ); ?> </ul> <?php } ?>
<?php if ( is_active_sidebar( 'sidebar-search' ) ) { ?> <div class="search"> <?= dynamic_sidebar( 'sidebar-search' ); ?> </div> <?php } ?>
Thanks in advance.
The page I need help with: [log in to see the link]
- The topic ‘Sidebars generating a 1 after HTML’ is closed to new replies.