Articles of widgets

register child class in another plugin

I think this should be relatively easy, but somehow I cannot figure out how to do this. essentially there’s a preexisting plugin that does this: add_action(‘widgets_init’, create_function(”, ‘register_widget(“Foo”);’)); if ( ! class_exists( ‘Foo’ ) ) { class Foo extends WP_Widget { /*constructs etc*/ }} now i would like to write another plugin (extension essentially), that […]

How to change color of registered widget areas in admin?

Right now they are all gray. How to change the color? I mean, how to add a class or id to the registered widget area that are shown in the admin area? This is how you register the admin areas in my functions.php right now: register_sidebar( array( ‘name’ => __( ‘Main Sidebar’, ‘twentyeleven’ ), ‘id’ […]

Are there any official or unofficial guidelines for the styling of a widget?

I’ve designed a sidebar widget and found that on many themes the widget looks fine. However, certain themes make the widget look out of place (clashing with colors, bad contrast, etc.) Are there any guidelines on how to properly style widgets so that they match most websites?

Unable to load “wpColorPicker” on theme customize page

Whether I’m using a WordPress default theme or a custom one, I see the JS error: Uncaught TypeError: Object [object Object] has no method ‘wpColorPicker’ when I click “Customize” on the theme. I’ve also noticed that on the widgets page nothing is draggable. I believe these issues may be related as I just moved this […]

How to pass a special CSS class into widget li

I have assigned a Sidebar into functions.php: register_sidebar( array ( ‘name’ => ‘Footer Widgets Area’, ‘id’ => ‘footer_widgets_area’, ‘description’ => ‘Assign Maximum 3 widgets into this footer sidebar area.’, ‘class’ => ‘my-class’, ‘before_widget’ => ‘<li id=”%1$s” class=”widget-container %2$s”>’, ‘after_widget’ => “</li>”, ‘before_title’ => ‘<h3 class=”widget-title”>’, ‘after_title’ => ‘</h3>’ ) ); In footer I want to […]

How to use the widget area to extend the page content?

I want to remove a widget area (lateral), and extend the page width getting this area. What is the better way to do it?

Sticky menu for WP custom menubars

This seems simple, except that I am not able to figure it out. In a wordpress theme, how can I make a custom menubar below the header image stick at the top after scrolling down the page? Example sites are and Here is the code I found on the net and am trying […]

How to add Wrapper Div/container element around WordPress Widget Content

I want to apply style to widget content of WordPress but I see widget Content area is not having uniform class. TextWidget are having class “textwidget” and that is uniform but other widgets are having “ul” as element for example and class is also different there. Can I add any wrapper Or a particular Class […]

Undefined Variable in my widget

I’m trying to get my head around writing custom widgets with options. I’ve been following a few tutorials and have been trying to understand as I go. I’ve got a widget that works perfectly in the Widgets manager, but on the front end I get Undefined variable: image_path. I can’t track down what I’ve done […]

Show Woocommerce Product “attributes/extra information tab” in widget

I have a question concerning WP in combination with WooCommerce, I hope someone can help me out. When viewing a product on the site I would like the “extra information tab” (containing all the attributes I added to the product) to be showed in a widget next to the product description (via a sidebar in […]