Social Follow Widget
About the widget
The Social Follow Widget can be used anywhere in the website, in order to add the social networks to follow. Common uses are in the header and footer of the website
It contains the following ways of sharing
- X
- TikTok
- Twitch
- Spotify
- Telegram
- Viber
- Vimeo
- Google News
- RSS
Enable Widget
In order for the Social Follow Widget widget to appear in the Widgets list (Appearance -> Widgets) we need to enable it.
Widget Override
If you need to override the widget in the child theme, you must inherit the parent widget of the parent theme. Inside your child theme folder (usually in wp-content/themes/nx-theme-child), create a relevant folder structure as the parent theme wp-content/themes/nx-theme-child/widgets. Create a php file that inherits the parent widget as follows
class Social_Follow_Widget_Child extends Social_Follow_Widget { ... widget stuff }
Next step is to replace the parent widget and yo can do so as follows
function replace_parent_widget() { if ( class_exists('News_Feed_Widget') ) { unregister_widget('News_Feed_Widget'); require_once get_theme_file_path('/widgets/News_Feed_Widget_Child.php'); register_widget('News_Feed_Widget_Child'); } if ( class_exists('Social_Follow_Widget') ) { unregister_widget('social_follow_widget'); require_once get_theme_file_path('/widgets/Social_Follow_Widget_Child.php'); register_widget('Social_Follow_Widget_Child'); } } add_action('widgets_init', 'replace_parent_widget', 15);