Try to combine both sidebars/arrays into one function.
function my_widgets() {
register_sidebar(
array(
'id' => 'contact-info',
// add the rest here
),
register_sidebar(
array(
'id' => 'social-links',
// add the rest here
))
);
}
add_action('widgets_init', 'my_widgets');
Then you call the deisred sidebar
<?php if(is_active_sidebar('contact-info')) : ?>
<?php dynamic_sidebar('contact-info'); ?>
<?php endif; ?>
Related Posts:
- How to get the registered sidebar’s name by its id?
- List authors with posts in a category
- Widgets not showing in my custom theme
- How to edit widget code to add unique class name to each div?
- Show different website layout if no sidebar added
- How do you create a custom category widget that you can style?
- How to use wp_get_attachment_image or wp_get_attachment_image_src instead of $instance[‘single_feature_image_uri’]
- How to include checkbox in widget backend form?
- Limit the number of inactive widgets
- PHP unit testing WordPress?
- Include a external PHP file into a WordPress Custom Template
- List of all theme customizer control types?
- How to remove hardcoded characters from playlists?
- function_exists call in function.php
- Debugging an error: wp_enqueue_style was called incorrectly
- Transform php code into a widget?
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- The best way to customize “nav-menu-template.php” to add if the ‘link_before’ is “checkbox”
- WordPress widget in custom theme
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Multiple do_shortcode($content) within one shortcode
- Remove css styles from specific page
- Anything I can add to functions.php to make text widgets accept PHP?
- WordPress menu deletes when trying to add a hook
- PHP Customization: Taxonomies and Queries, why? [closed]
- How can I add a specific, custom widget to my theme’s header.php?
- Get widget settings function?
- What is the fastest way to load PHP functions that are only used in one theme template?
- My Own layout in WooCommerce pages [closed]
- How do I access the media settings
- Can’t load WP function into external function
- Implement toggle switch for theme options in settings API
- How can i upload images in an admin page?
- Wp-login appears White Screen, Error: Cannot modify header information
- Need Help Fixing My Iframes [closed]
- Hide subcategories (widget)
- Adding a widget function into the php theme file
- Compare the old get_theme_mod($name) to the new get_theme_mod($name) return value
- How do I link a button I created in theme customizer to a function?
- can i fetch a custom metabox data in another page or post type?
- Archives shortcode displaying above widget title
- Is the “_s” on this `sprintf(__(‘Page %s’, ‘_s’), max($paged, $page))` just refer to a text domain?
- Widgets in the loop if active
- ‘Post-thumbnails’ feature does not seem to register
- WordPress admin-ajax.php
- How to obtain the current website URL in my theme?
- Syntax error when I try to insert my loop into an unordered list? [closed]
- What exactly do this function declared into functions.php file of a WP theme?
- Admin ToolBar not being displayed at top of site
- Royalty-Free Sliders used in theme development
- Reason to add a name of the theme like (‘menu-1’ => __( ‘Primary’, ‘twentynineteen’ ),) in PHP?
- Separation of presentation and code – WordPress
- Search form does not work in my website
- Hook called before text widget save
- zip unzip attachments in wordpress
- get_template_directory adding FTP root folders in urls
- Live to Local on MAMP, not working, outputting functions.php code
- get_comments_number() returns 0
- get_page_templates only return templates with “home” in the filename
- Why the dynamic_sidebar() call is putted into an ul tag?
- Toolbar Hidden in a Virtual Page
- Remove Custom Post Category In WordPress Slug Using .Htaccess
- How do you remove header sitewide from mobile only?
- PHP inside echo HTML
- Uncaught TypeError: extract(): Argument #1 ($array) must be of type array, null given
- Header is not displaying on certain pages of wordpress theme [closed]
- Retrieve the whole widget sidebar and pass it inside an html
- Check if current post in loop is last on current page
- is_user_logged_in returns false when I access certain pages
- REST API custom endpoint to fetch pages and posts not working
- Looping through dummy posts and showing them in the main index.php
- Trying to get pagination working on WP_Query() post grid
- Warning: count(): syntax problem of the count () function
- Fix hover images blink
- Customizer: How to Sanitize a Decimal Number Range
- PHP code printed into CSS classes
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- Featured Products not showing up in “Featured” area of homepage
- Get the image title and alt from custom query
- What syntax is this? “{{post.price}}”
- Widget Update problems using a for loop
- How to replace hard-coded list of custom taxonomy terms based on custom field query [closed]
- How can the searchform.php know if it’s used on a registered sidebar id ‘sidebar-1’ or ‘sidebar-2’?
- Non-static method error when trying to use class in widgets
- WordPress get_post_meta issue
- How to correctly add the featured immage (thumbnails) support in a WP theme? Why I can’t add a featured immage?
- List sibling pages widget, exclude current page
- Widget header unique classes
- Listing current pages subp page in list items in the sidebar
- How to add button to top of theme customizer?
- Sidebar doesnt get updated?
- Edit the Publish Widget Options
- Add CSS class to PHP Statement
- ACF | WooCommerce | Theme Development | How to include a /template-part/ that makes use of ACF’s on a custom WooCommerce homepage?
- Load slideshow.css file only if Slideshow is checked / on
- Predefine Magazine Style Layouts
- Twig+WordPress how to use array arguments inside a function?
- How to store the_post_thumbnail() value in a variable
- Add default block css when the block has been added with php?
- Font Awesome Icons as squares [closed]