Target logic based on Widget / Sidebar Name

You can write the logic inside widget functions. When the widget is added in sidebar, it will check for sidebar name and home page. global $wp_registered_widgets, $wp_registered_sidebars; $sidebars_widgets = get_option(‘sidebars_widgets’); if($sidebars_widgets[“sidebar-1”] && is_home()) { //Write your logic here }

Expanding a function to call a plugin or show a link

Have you tried: function my_members_only_shortcode($atts, $content = null) { if ( !is_user_logged_in() ) { $content=”<p>This content is for members only. Please log in or register first.</p>” . do_shortcode(‘[do_widget “Social Login” ]’); } return $content; } That should replace the content with your message and special short code content only if the user is not logged … Read more

Change Widget that display posts from categories to tags

The main changes needed in order to use tags instead of categories would be: In section one, change… $args[‘category__in’] = $categories; to $args[‘tag__in’] = $categories; And in the second section, change the cats loop: $title = esc_attr($instance[‘title’]); $number_posts = (int) $instance[‘number_posts’]; $categories = (array) $instance[‘categories’]; echo ‘<p><label for=”‘ . $this->get_field_id(‘title’) . ‘”>’ . ‘Title: ‘ … Read more