Widgets are configurable elements used to dynamically build sections of a WordPress theme.

learn more… | top users | synonyms (2)

4
votes
2answers
2k views

Is there any way to dynamically alter widget titles?

I have a case where that are a lot of widgets in several custom sidebars. I am wondering if there is a simple way to alter the titles of each widget dynamically. Typically a widget has a title field ...
4
votes
3answers
10k views

How to add a specific widget to only 1 page?

I would like to show a widget in only one page of my site, as i can see it is not possible right? Should i add that for all my site pages or not?
4
votes
2answers
6k views

check if registered sidebar is active & has widget content

I'd like to check if a registered sidebar has widget content - but can't seem to find a WP function for this - is_active_widget checks if it has content, but not if it exists or not. function ...
4
votes
4answers
336 views

Does the number of widgets installed affect website performance?

Does a website slow down or under perform in any way with a large number of widgets installed?
4
votes
2answers
5k views

Give Editor Access To Sidebar

I want to give the Editor Role access to editing the sidebar and it's contents. I have a text widget in there and in order to edit this text widget the user needs to be an admin - this sucks. How do I ...
4
votes
2answers
8k views

How to edit widgets in WordPress

In the Appearance -> Widgets menu there is a list of widgets that you can drag and drop to show in the sidebar. Where is the HTML/PHP code for these custom widgets? I've been on WordPress's Function ...
4
votes
2answers
2k views

Is There A Hook To Process The Content Of The Text Widget?

Is there any filter which can be used in a plugin to process the content of the text widget before it is rendered?
4
votes
1answer
4k views

How to include checkbox in widget backend form?

I'm trying to include a checkbox in my widget back end. But I cannot get the value (on or off) after the user submits it. I thought the value would be stored in "esc_attr( $check )" (as it is when ...
4
votes
2answers
989 views

Call dynamic_sidebar but include/exclude named widgets?

Is it possible to include or exclude specific named widgets that are assigned to a named dynamic_sidebar call? For example, if I've registered a sidebar named "my_sidebar" and the user had placed a ...
4
votes
1answer
551 views

Enabling jquery when dragging available widget to sidebar area

So I have some widgets that are using some custom jquery on the backend. I can get the widget forms to call the jquery files but only AFTER I've saved the widget and reloaded the page. Is there ...
4
votes
2answers
2k views

Add a custom walkter to a menu created in a widget

I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu ...
4
votes
5answers
3k views

Sharing Dynamic Sidebars across Multisite Blogs

I'm trying to find away to retrive a dynamic sidebar from one blog and print it on another blog in the same install of Wordpress Multisite. I have tried switch_to_blog($blog_id); ...
4
votes
1answer
1k views

How to add author details in the post sidebar?

I would like to add author details in the sidebar instead of bottom of the post? Can anyone tell me how to do that? As of now i'm using like this in the loop <?php $curauthor = ...
4
votes
1answer
7k views

Adding iframe Content to Sidebar Widget

I'm trying to add an Amazon advertising widget in a WordPress sidebar widget (self-hosted WordPress, v3.1.3). The widget code is basically an iframe. I've tried using the "Text" widget and pasting ...
4
votes
2answers
3k views

Moving WordPress.com theme and widget settings to self-hosted site?

Possible Duplicate: Migrating from WordPress.com to self-hosted site and autoforward visitors? How can I move theme and plugin (widget) settings from a WordPress.com site to a self-hosted ...
4
votes
1answer
1k views

Switching themes without losing widgets?

The other day, I switched from 2010 default them to Semiologic, then back. When back to the 2010, all my appearance/widgets had gone back to the default. Does this often happen? What is the best ...
4
votes
1answer
83 views

How to use wp_dequeue_style() for style enqueued in WP_Widget class

I've got a plugin that makes a widget that enqueues some front-end CSS to style the widdget. I call wp_enqueue_style from the public widget() method in the extended WP_Widget class: <?php class ...
4
votes
3answers
3k views

Get page IDs based on which template they are using?

I have a situation where I need to provide a dropdown of pages in a widget, based on whether they are using a specific template. In other words, for all pages using template 'Foo', get the post ID. ...
4
votes
1answer
2k views

How to use is_active_widget?

This is the manual page and this is the code. But I'm still struggling to understand how to use this function. Perhaps I am using it right, but something I can't think of is wrong. But more surely, I ...
4
votes
3answers
2k views

A plugin to show post tags in a widget

I'm looking to show the tags of a post within a widget. I know this is hard because it's outside of the loop, but has it been done, is there one available? Thanks for any assistance. Hudson
4
votes
2answers
2k views

How to add a filter to all widget output

Is there one last filter that is ran over the widgets before they are sent out to the browser? I would like to add a filter that adds rel="nofollow" to all links in all widgets. For instance, I can ...
4
votes
2answers
421 views

Can I display the widget admin in the page admin?

I would like to show the 'Appearance -> Widgets' menu underneath the text field in 'Pages -> new/edit'. Is it possible to take one part of the admin and show it elsewhere? Reading some of the ...
4
votes
3answers
1k views

Widget development - Drop down options won't save

So, i successfully managed to add a drop down option, the problem is when i click save all of the options are removed, however the chosen option is implemented successfully. Here is the relevant ...
4
votes
2answers
3k views

Get sidebar parameters (before_widget, before_title, etc.) from within a widget

Is it possible to dynamically get sidebar parameters from within a widget? That is, I am trying to access the before_widget/after_widget/before_title/after_title/name parameters of the containing ...
4
votes
1answer
159 views

Storing custom dashboard widget options in wordpress

I am using the Codex example to build a custom widget. The specific example seems to be working fine until you click configure and change options values. After you click submit, changes are not saved. ...
4
votes
3answers
1k views

Has anyone managed to integrate the wp_editor inside a widget?

Adding this in the widget form method: wp_editor($text, $this->get_field_id('text')); seems to work. But after you press the "Save" button the widget goes funky... Adding ...
4
votes
1answer
550 views

Video Embed in Sidebar Widget with Links to Others in Category

I am trying to re-create the sidebar widget found here: http://www.clinicalforensicpsychology.org/ The links below the shown video are linked to the post category "videos". I have tried most every ...
4
votes
2answers
1k views

Remove before_widget / after_widget content from Wp_Widget_Text

I want to take the text widget and remove the preceding / trailing markup from the text output currently showing as <div class="textwidget">Test</div> The before_widget / after_widget ...
3
votes
3answers
2k views

How to enqueue script if widget is displayed on page?

I created a widget that uses a jquery plugin, and I used is_active_widget to enqueue the script, it's working fine but it's also including the script even on pages that doesn't show this widget. so is ...
3
votes
3answers
3k views

Get number of widgets in sidebar

How can I get the number of widgets that are active on a specific sidebar? Is there a core function for this? I want to add a class to each widget on a sidebar based on how many of them are ...
3
votes
2answers
2k views

Getting post-thumbnails from another WP site

I have two WordPress installations, one at http://inversekarma.in and the other at http://inversekarma.in/photos. The latter is a photoblog, and its theme uses the standard WP post thumbnails (EDIT: ...
3
votes
2answers
1k views

How To Determine If A Filter Is Called In A Sidebar/Widget Context?

So I have a plugin that appends or prepends an enhanced author biography to the content of a page/post/custom post type. It does this by hooking to either the_content or the_excerpt and ...
3
votes
2answers
748 views

Widget with random posts from a blog for external sites

How can I create a customizable widget with random posts from my blog that can be published on another site as js, iframe or div. Is there any Wordpress plugin for that?
3
votes
1answer
613 views

Loop through widgets in sidebar

I have a sidebar called footer, I know I can use dynamic_sidebar() but I need to be able to split that into individual widgets. I have the following so far which gives me the widget name e.g. text-1, ...
3
votes
1answer
3k views

Get a list of all Widgets registered in WordPress admin widgets-area

I'm trying to disable a couple standard widgets in my theme functions.php. Therefore I wrote this little function, which works well: function my_widget_ctrl() { ...
3
votes
1answer
437 views

Register multiple sidebars

I am registering my sidebars as follows: $sidebars = array ( 'sidebar-10' => 'Main Sidebar', 'sidebar-11' => 'Homepage Area One', 'sidebar-12' ...
3
votes
2answers
111 views

Delete Custom Dashboard Widgets

Here is the code on how to delete all dashboard widgets - the default, and plugin widgets but I want to change the code to only delete custom dashboard widgets not the default ones. // Create the ...
3
votes
1answer
432 views

How to use control_callback when creating a widget via functions.php or plugin?

I've created a dashboard widget in my functions.php file. I want to have it be able to update some stuff in the database upon form submittal. According to the codex documentation, I should be ...
3
votes
2answers
346 views

Add New Footer Widget Area with Limited Options?

I'm trying to add a new footer widget area to my theme. I was able to add the new footer widget area and it works correctly. But I would like to limit what can be done with the widget area by the end ...
3
votes
1answer
480 views

Why will using __construct instead of widget_class_name when creating widget trigger out of memory error

I find that if I use class widget_name extends WP_Widget { function __construct() { ... } } instead of class widget_name extends WP_Widget { function widget_name() { ... } } I get an ...
3
votes
1answer
540 views

Should I use set_transient or update_option?

I want to store some Twitter API data in WordPress. After every hour, I want to fetch new data from Twitter, and update only if the data is successfully retrieved from API (sometimes the API gives ...
3
votes
2answers
2k views

Override dynamic_sidebar() in plugin?

I'm writing a custom plugin that allows a particular page to have it's own sidebar with widgets. It works great so far, but what I'd like to do is generalize it more and allow the plugin to ...
3
votes
1answer
2k views

Widget to display custom taxonomy tag cloud

How to alter the default widget to display a tag cloud of a custom taxonomy?
3
votes
2answers
1k views

Copy widget settings from one blog to another

I am trying to hook 'wpmu_new_blog' in a plugin so I can copy the widget settings from one blog to the new blog that is being created. Does anyone know if there are WordPress functions to accomplish ...
3
votes
2answers
10k views

Disable Specific Widgets on Selected Pages of a WordPress Website?

I would like to give a CMS look to some of my pages. I want to customize them by removing the default widgets and adding other widgets as my wish (I will use plugins like My Custom Widget to add ...
3
votes
2answers
1k views

What is the best way to include a widget in a Page?

I am setting up a new WordPress blog and would like to include a widget in the content of a Page. I found some forums describing PHP hacks which appeared to apply to older versions. With WordPress ...
3
votes
1answer
182 views

How to update widget from widget() function?

I'm trying to create a simple linkroll widget for displaying recent https://pinboard.in links via their API. To maximize loading speed, I want to cache the linklist in a widget field, as well as the ...
3
votes
1answer
174 views

Programmatically edit the text of a widget

I have text widgets that contain text. I'd like to programmatically edit that text. Is there a way to do that?
3
votes
2answers
2k views

How to add color picker to widgets?

I have some problems adding the wpColorPicker to a Widget. Does anyone have a working sample? It only works when I click on 'Save' or reload the page, but when I drag a new widget to the area it will ...
3
votes
2answers
6k views

Where is the content of widgets stored in mysql table

I have the cPanel access to a website but no wordpress login info. So I wants to change a widget content in the website. How can I change it through phpmyadmin. Where are that widgets sidebar data ...