Conditionally Load a Script if a Certain Widget is Shown on a Page

I think what you are asking to do is not possible. At least not cleanly. Why? Because the actual rendering of sidebars and widgets happens in the template files. get_sidebar() gets called from a template file which then calls the WP_Widget::widget() method for whichever widgets are assigned to the sidebar in question. But this happens … Read more

Loading scripts only if a particular shortcode or widget is present

You can use the function is_active_widget . E.g.: function check_widget() { if( is_active_widget( ”, ”, ‘search’ ) ) { // check if search widget is used wp_enqueue_script(‘my-script’); } } add_action( ‘init’, ‘check_widget’ ); To load the script in the page where the widget is loaded only, you will have to add the is_active_widget() code, in … Read more

Widget text color change

This CSS will make your grey text in some else you want: .widget_posts_wrap .latest-posts .col-md-12 a span {color:#your-hex-code !Important;} This is for subtitles in this widget where you have latest post. And this is for titles: .widget_posts_wrap .latest-posts .col-md-12 h3 a {color: #your-hex-code !important;} Also just note to change #your-hex-code part with actual hex code. … Read more