Articles of widgets

Removing custom widget area WordPress 4.4

I know it is a very simple thing but I just cannot figure it out. I always used to define widget areas and sidebar in source code, however this time I have used the UI option from Appearance > Widgets to create a widget area. Now I need to remove, however I cannot find how […]

Theme Customizer – Choose where widget area appears, to let users organise widgets

I am creating a theme, and I have a problem with Widgets and Widget Areas. I am using the Theme Customizer to let the user edit the content, colors, etc. I know how to create a widget area. I need to be able to add that widget area to a specific section in the theme […]

Including Custom Post Type posts in a page template contextually (or should I widget?)

Please see the attached mockup… Each element in the sidebar (e.g., Communications) will probably have to be a Page. I’m aiming for maximum flexibility. I am using Epik (a Genesis child theme). I am trying to avoid having the people who will be creating the content for this site needing to know HTML/CSS so I […]

Why won't my custom widget stay in the sidebar after a reload?

After I drag my custom widget into a widget area and reload the page it’s gone. Any ideas? <?php add_action(‘widgets_init’,’register_postTypeWidget’); function register_postTypeWidget(){ register_widget(‘postType_widget’); } class postType_widget extends WP_Widget { function postType_widget() { $widget_ops = array( ‘classname’ => ‘postType_widget’, ‘description’ => __(‘Display Posts by Post Type’) ); $control_ops = array( ‘width’ => 300, ‘height’ => 350, […]

More flexible sidebar and widget management

I’d like to have a plugin for a flexible sidebar/widget management. In fact, I want to give a user the possibility to choose which sidebar should be displayed per page/post. I know there are many sidebar plugins out there. Unfortunately, I haven’t found one which cover all my wishes. So I’d like to code this […]

the_widget() and widget's ID

Let’s assume I have a widget that displays only its name: <p> <?php echo $args[‘widget_id’] ?> </p> So when I drag & drop my widget to any sidebar it shows: <p> myWidget-number </p> The problem is I want to call this widget with a shortcode: (…) ob_start(); the_widget(MyWidget); return ob_get_clean(); } add_shortcode(‘myWidget_short’, ‘myWidget_shortcode’); And when […]

Count widgets of a certain type

How can I get the number (count) of, let’s say, text widgets from a sidebar? for eg. if I drop 4 text widgets in the sidebar, I want to get this number somehow from another widget

Widgets with groups / sub widgets? Widget in a widget?

I tried to find anything about adding a widget within a widget area. That widget should be a widget group / sub widget area. I’ve found a plugin that does this: What I really want is to dynamically create something like this without the help from plugins: Any bright ideas?

Using tabs in admin widgets

Update: I should point out that I tested the method below on Plugin/theme options page and it worked perfectly. In-fact I was also able to include the jQuery cookie Plugin to preserve the current tab selection between page loads (nice!). Been trying to add tabs to an admin widget to reduce the form footprint when […]

Custom Menus, Widgets & Conditional Statements

I’m employing custom widgets for my client because it’s easy and they have several menus they need to create specific to site sections. I then want to allow them to add to the custom menu dynamically using widgets (I create the spaces needed for the widget and they drag and drop the menus into that […]