Run JS after widget settings are saved?

Put your javascript code inside the widget form, and it will be triggered whenever the widget is refreshed. If you’re tabs are hooked on a click event, a better way would be to use $.delegate on the widget instance wrapper. That way you don’t need to include the js inside every widget instance…

Changing $before_widget for certain widgets

There are 2 ways to allow separate styles on each widget. The first is to add separate classes to the widgets like this: First Method register_sidebar(array(‘name’=>’sidebar1’, ‘before_widget’ => ‘<ul class=”black-bg”><li>’, ‘after_widget’ => “</li></ul>”, ‘before_title’ => ‘<h2 class=”widgettitle”>’, ‘after_title’ => “</h2>” )); You can then use the .back-bg class to style the widget like this: #sidebar … Read more

How can I display widget in a Page or Post?

There’s no easy way to do this. Many plugins that provide a widget also provide a shortcode (text in brackets that you can put in your post like this: [quora]). I have no idea whether either of your widgets also come with shortcodes. Though I’ve never used them, there are some plugins that claim to … Read more

Pre-install widgets in WP-Admin

That’s not actually installed by the theme. Those widgets are set up as soon as you install WordPress the first time. It’s just that if your theme doesn’t support widgets, you won’t see them. The part of WordPress that “installs” these widgets can be found in wp-admin/includes/upgrade.php inside the function wp_install_defaults. Here is the relevant … Read more

Forcing the title of a text widget on to a new line in the admin area

You can try this custom CSS code to enable multiple title lines for the widgets in the backend: function custom_css_wpse_98587() { echo “<style> .widget-top{height:auto !important;} .widget-title h4, .widget-title span.in-widget-title{ white-space:normal; } </style>”; } add_action(‘admin_head-widgets.php’,’custom_css_wpse_98587′); This is how the widgets show up in my Chrome browser: Before: After:

How do i display the built-in gallery inside a widget?

Widgets don’t usually allow shortcodes in them (they treat them as normal text). What you have to do, is to tell this widget, it should run do_shortcode on it’s text. To do it, you can use this snippet: add_filter(‘widget_text’, ‘do_shortcode’); Just place it in your function.php file. Then you can place shortcodes in Text Widget … Read more