Check this out, it may guide you in the direction you need:
First:
register_sidebar( array(
'name' => 'Social Media button',
'id' => 'smb',
'before_widget' => '<li>',
'after_widget' => '</li>',
) );
Second code:
public function widget( $args, $instance ) {
$output = $args['before_widget'];
$output .= '<a href="' . $instance['url'] . '" class="fa fa-' .
$args['icon_title'] . '">' . $instance['title'] . '</a>';
$output .= $args['after_widget'];
echo $output; // <li><a href="https://wordpress.stackexchange.com/questions/229461/[URL]" class="fa fa-[ICON]">[TITLE]</a></li>
}
The output from those changes will be :
<h1><li><a href="http://url.com" class="fa fa-">New title</a></li><li><h2 class="widgettitle">test1</h2>
<div class="textwidget">test2</div>
</li></h1>
And will only do this on the social sidebar.
Related Posts:
- Limit the number of inactive widgets
- Is having multiple theme customizers for different pages possible?
- Remove Customize Background and Header from Appearance admin menu without CSS or JS
- Create Image Uploader for Widget
- Displaying a variable stored in functions.php inside widget
- WordPress customizer: load controls in a custom div
- Check if widget has content
- Dynamically change feature image in customiser
- Transform php code into a widget?
- Design view breaking on Pages
- Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin – Adding to “Thoughts” Theme
- Customizer Show/Hide Logo and Site Title
- List authors with posts in a category
- Theme Customizer – Dynamic CSS PHP File
- How to get custom image size for image uploaded in Customizer
- How to add Shortcode (font awesome) in widget title?
- dynamic sidebar not showing anything
- Crop image from get_theme_mod Customizer field
- javaScript in section of WP API
- Style every second widget?
- How to group 2 radio buttons in a widget?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- custom widget on the footer
- Missing sidebar parameter “fix” – before_content
- How do I get current page ID in WordPress customizer file?
- How to add just one specific page to widget without plugin?
- From where the header-text can be changed in WordPress custom header?
- Dynamic Sidebars & Echo
- Create a range slider to change font-size with different screens sizes in wordpress customizer api
- WordPress Shortcodes.. printf is outputting a random number… Can’t figure out WHY?
- Customizer: Multiple CSS styles on same element in Live Preview
- Customizer: Category Select Sanitize
- Why my image upload button is not working in wordpress widget area?
- Skt full width basic slideshow problem
- How to determine if the sidebar is empty? Or not active?
- How to make widget title accept php?
- Widget back end radio button issue
- Why is an array created in a function hooked to customize register populated when customizer is loaded but not when the front-end is loaded?
- WordPress widget and customize.php not working in Ubuntu16.04 VPS
- Customizer: How to change Header Image description
- Correctly Using checked function of WordPress
- get_theme_mod outputs number when using WP_Customize_Cropped_Image_Control
- How to get post category list as select in front-end?
- Simple php in wordpress widget [closed]
- Show different website layout if no sidebar added
- Need advice on theme customizer and child themes
- random reason on refresh
- Add a select-option to the default widgets
- Don’t display a sidebar widget when on a specific page
- Some problems in custom widget
- WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
- OOP PHP class extends TwentyTwenty_Customize in Child Theme
- How do you create a custom category widget that you can style?
- Why would the child theme load in the Customize preview, but not on the site itself?
- How to use wp_get_attachment_image or wp_get_attachment_image_src instead of $instance[‘single_feature_image_uri’]
- require get_template_directory() . ‘path/to-my/file.php’ BREAKS customize > themes functionality
- Current WordPress Page Title as Search Parameter into A Tag
- How to add locations input to user profile?
- Add widget area from visual editor
- Customizer textarea with script tag won’t work in live preview
- How to make a “page-option” in WordPress
- Allow user to choose header style
- Remove specific javascript when viewing page in Customizer?
- Priority call methods – PHPMailer->addAddress(NULL)
- is_user_logged_in() not working in homepage
- Dynamic_sidebar load in string makeup
- missing admin bar and widget in a template
- 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
- (Who to follow) Twitter widget
- My own theme’s custom widget areas are not working
- make an array in wordpress cusmization api?
- Widget Logic – display on page and all child
- Add disclaimer before certain posts and pages
- Use Custiomizer to setup meta theme color tag
- Default Image not showing up in Customizer for WP_Customize_Cropped_Image_Control
- How to list categories by page id in wordpress
- customizer live preview layout picker
- Are WordPress widgets cached?
- widget: input the px value from user and use it as inline style in widget function
- Update title of every instance of widget using text field
- Are widget arguments always set inside My_Widget::widget()?
- Replace content in WordPress Page after GET from php page
- WP_Widget dynamic field array with external AJAX
- Name Input from widget displays Sidebar name instead of saved data
- WordPress – show number of comments for each post in widget
- Widget header unique classes
- key( $GLOBALS[‘wp_registered_sidebars’] ) is always showing the same value
- How can I clear the theme mod settings?
- Cant get theme to change footer color through theme customizer
- PHP Widget and do_shortcode
- How to define template directory in this widget code
- Echo piece of code from file
- WP Debug enabled Undefined index error in a widget
- How to edit a widget code?
- Capture the Selected Radio Button Value between two files in wordpress theme
- WordPress Customizer add_control Dropdown of Pages with Multi Select?
- wordpress-plugin (widget) that performs a Neaby-search on the openstreetmap-endpoint: around x find y
- How do I create a single.php file as the default template for single posts in the twentytwentythree theme?
- Partial refresh in WordPress live preview