Non-static method error when trying to use class in widgets
Like the error suggests, your are calling the function statically. If you wanna use it that way you gotta change function input to: static function input
Like the error suggests, your are calling the function statically. If you wanna use it that way you gotta change function input to: static function input
The customiser should not make a real difference in you decision as widgets are customized from the customizer as well. In general widget areas (sidebars) should be used whenever the user has the option to put any kind of content in it. If the content has to be very specific you should start looking into … Read more
Handling dozens of sidebars
I think this is what you are looking for You need to get the custom post meta and add it to the wp_add_inline_style( $handle, $data );, I advise using the “style” default handle. The position of your custom css will depend on the hook of your stylesheet.
First off, try to work on your code formatting. As it is, it’s rather unreadable and this makes it not only more difficult for us to understand how to help you, but also less scalable and suited for future use. Always try to adhere to the WordPress PHP Coding Standards. Now, on to the beef … Read more
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
Custom file with special code of category widget
Changing the include_once within form() to require solved the bug.
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
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