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

learn more… | top users | synonyms (2)

2
votes
2answers
2k views

Wordpress multiple widget in single plugin

In my plugin in need to create two widget. One is :social rank" another is "Profile Rank". This is the code which i am using here. <?php add_action( 'widgets_init', 'src_load_widgets' ); ...
2
votes
2answers
184 views

How could a Widget behave differently depending on sidebar

if sitting on sidebar-1, I need my widget to behave differently than if it were on sidebar-2. How can i detect the sidebar it is sitting on from within the widget() function? The widget contains a ...
2
votes
1answer
2k views

How to limit wp_get_archives to show months for the X years only

Can anybody show me how to set a limit on wp_get_archives to show archives by month BUT only those for the year 2010 and above - so the 2009 monthly archives are not shown on the sidebar archive ...
2
votes
1answer
410 views

Creating your own widgets: using cache?

I'm in the process of making my own widget but I don't like it to fully generate the content each time since the process is quite lenghty. I can easily create my own caching mechanism but I'm ...
2
votes
3answers
941 views

Using $wpdb object in a widget

I'm trying to make a very simple widget that access tables contained within the same database instance as my Wordpress database, but are not wordpress tables. I'm using the wpdb class according to the ...
2
votes
1answer
390 views

Schedule cron event from widget

Can I use wp_schedule_event() to set up a cron job from within a widget? I tried, but I can't make it work, The problem seems to be the $hook parameter. The function I'm trying to hook is located ...
2
votes
3answers
183 views

Why can't I add this feed to the RSS widget?

I wish to use the following RSS in my widget, but it seems to not pick it up: http://www.tapuz.co.il/blog/rssBlog.asp?FolderName=TickTack I imagine there is a problem in the feed. So: What is it? ...
2
votes
1answer
70 views

List sidebars on a page

I need to generate a list of sidebars on a given page. I know how to list all sidebars that have been registered, and all sidebars that have been registered that have active widgets, but I do not know ...
2
votes
1answer
196 views

How do I add Widgets to my theme and activate them on my site?

I registered the widget area in my functions.php and they appear in my admin area but when I drag it over to the right hand panel to make changes none of them seem to do anything. Anyone know what I ...
2
votes
1answer
3k views

Custom widget using get_categories select menu dropdown

I have created a custom widget that is supposed to display a select menu with all the categories the blog has. I have used get_categories to compile the list. This works fine and all categories appear ...
2
votes
2answers
602 views

How to delete cached transients from a widget instance properly?

So I have created this widget which pulls a number of posts. And the query is being cached via transients. But I need the transient to be deleted whenever a post is saved so the query can be ...
2
votes
2answers
289 views

Different rss feeds in a single dashboard widget

I am using this snip of code to get rss feed on my dashboard as widget. It becomes problematic when it displays 5-6 different rss feeds which makes me run down deep. How can I add 6 different feeds ...
2
votes
1answer
588 views

Widget Options Not saving

I am trying to create a custom Recent Posts widget that accepts a category, to show only posts in that category. I'm having trouble saving the widget options. I've done some debugging and found that ...
2
votes
2answers
86 views

Detect if a plugin was included in a certain page

I´m developing a theme that include plugins. One of this plugins is a contact form. And this plugin have an asociate code to validate input data. Because I don´t know in what pages contact form was ...
2
votes
2answers
344 views

Separate backend “Widgets” page for each language

Im currently trying to make my backend work with multiple languages. Im using qTranslate as my translation plugin. So far I have accomplished a custom option page with multi-language support. When ...
2
votes
3answers
621 views

Use wp_enqueue_style based on user option in widget

I currently developing wordpress widget for my website. This widget will pull user latest post in my website and show in their blog. In the widget there is option for user to use their css or my css ...
2
votes
3answers
477 views

wordpress widget textbox in the sidebar

I have a normal textbox widget that I am using in certain sidebars. The text widget generates a div within a ul. Is there anyway to make the widget generate another ul li instead? ...
2
votes
1answer
962 views

WordPress Widget multiple use

I created this widget using a simple example on WordPress Codex: <?php function widget_container_latest_posts() { global $wpdb; global $post; ...
2
votes
1answer
237 views

Anything I can add to functions.php to make text widgets accept PHP?

Is there a way I can make text widgets accept PHP? Perhaps something I can add in to functions.php? I'm redesigning my site, and I was wondering why I didn't use widgets at all in my current design, ...
2
votes
1answer
3k views

Is there a need to do apply_filter('widget_title', $instance['title']) or any other 'widget_xxx' filters?

I am reading the book Professional Wordpress, and have code like $title = apply_filters('widget_title', $instance['title']); $name = apply_filters('widget_name', $instance['name']); ... I wonder if ...
2
votes
2answers
2k views

Bookshelf plugin and/or widget [closed]

I'm looking for some kind of plugin and/or widget to display a list of book covers in the sidebar. Are there any good options out there?
2
votes
3answers
8k views

Which tabs widget plugin for wordpress is better? [closed]

I see there are a lot of plugins to create tabbed widget in side-bar: Fun with tabs Post 2 tabs Hybrid Tabs Wordpress Tabs Slides AmR Tab Menu Navigation Tabbed Widgets Which one is the best in ...
2
votes
1answer
2k views

Changing name of sidebar widget

I have created dynamic sidebars. They are working fine and appear in the Widgets area. However, I would like to customize the name that appears on each sidebar. So, right now each sidebar is named ...
2
votes
1answer
1k views

Enabling Widgets By Default in Custom Theme Development

In WP theme building, if a sidebar is not active, can I turn it on? Also, if the sidebar is active, and doesn't contain any widgets, can I add some? I'm a theme and plugin developer, but this is ...
2
votes
5answers
299 views

WP_Widget deprecated error in Wordpress V4.3

This error only happened this morning as I updated my wordpress site to version 4.3. Two other sites on the same hosting ( and all using CPanel as an admin portal for the hosting) are not having any ...
2
votes
1answer
30 views

How to listen to color changes on the color picker?

I am trying to run some custom jquery function every time the colorpicker's color change. The colorpicker is include as part of the WP core. I have been looking at the JS code, but I can't figure out ...
2
votes
1answer
937 views

Widget options get

How to get widget options? I've tried like this, like seen in the other question "Using widget options outside of the widget": $w=get_option('widget_wp_mywidget'); $one=$w[2]["myval"]; ...
2
votes
2answers
640 views

Elegantly using JavaScript on widget admin forms

I'm working on a project involving a lot of widgets, and I'm thinking it'd be really great to have a "More options" section built using jQuery UI Accordion that expands when clicked. So, I've ...
2
votes
2answers
431 views

Add class to before_widget for all widgets with a dropdown and a counter

Some predefined widgets offer the option to use a select element (dropdown) and/or a counter after each entry. How can I add the CSS classes widget-with-dropdown or widget-with-counters to these ...
2
votes
2answers
735 views

Reorder dashboard widgets

I recently tried to reorder the dashboard widgets by writing a plugin. I accomplished this: with the following code: <?php /* * Plugin Name: Custom Dashboard * Description: Custom dashboard ...
2
votes
1answer
512 views

Make compatible custom menu widget for Twitter Bootstrap

If I configure wp_nav_menu function, I can put the "items_wrap" option to achieve a nice navigation given by Twitter Bootstrap, thus: <ul class="nav nav-pills">%3$s</ul>. But, how to ...
2
votes
1answer
73 views

Query for recent images across multiple posts

I'm a bit fresh to wordpress theme development (and PHP in general), and I'm curious if there is a way to query XX number of recent images, likely spanning across multiple posts. Basically I want to ...
2
votes
1answer
173 views

How does the default recent posts widget work with cache?

I am trying to build a widget based on the default wordpress recent posts widget. In wp-includes/default-widget.php , I noticed in class WP_Widget_Recent_Posts in function widget(), the recent posts ...
2
votes
1answer
2k views

How do I register a stylesheet inside a WordPress widget?

I'm developing a WordPress widget following Dave Clements tutorial. It works well. Now I want to add some styles to it. I want the styles to be in an extra css file which will be loaded during ...
2
votes
1answer
87 views

Multiple users editting widgets

I have just completed a website using WordPress as a CMS, the site has 6 people administering the content and in the couple of days before launch all 6 were updating the content. We found that if ...
2
votes
1answer
962 views

How to generate and display widgets areas dynamically?

I want display different content in sidebar for every category, but as I create new ones I have to create the area for it. How can I have widget areas for every category and also display them on theme ...
2
votes
1answer
462 views

Closest thing to an is_widget() tag?

I have a custom widget with a WP_Query loop that's using get_template_part() to include some standard information that I also use in theme files. However, I need to make one small change to the ...
2
votes
2answers
246 views

Dynamic content in a widget

I have to make a widget from where the user will be able to add a few images and then I will show only some of them, randomly, and it will be automatically changed on page refresh. The problem is that ...
2
votes
2answers
603 views

How to get popular post from across a network?

I have a multisite network on WP 3.3.1. I now need to get all popular posts from across this network (preferably based on the amount of views). Is this possible, and how do I do that?
2
votes
3answers
109 views

Is it a good idea to make whole theme widgetized?

I have mainly seen sites using widgets on sidebars or inside multi-column layout. However, I was wondering what if we could use widgets in every blocks like header, main content block, footer etc. Is ...
2
votes
2answers
1k views

How to place random widgets in the Wordpress sidebar?

My pages have a sidebar with too many widgets, and it looks bad when the content is short and the sidebar is too long. I want to randomize the widgets I'm showing in the sidebar. Meaning I will add ...
2
votes
1answer
563 views

Add new section to “Right Now” widget

I've been hacking away at modifying the "Right Now" widget in the WordPress dashboard, and although there are some hooks/filters which apply to just that, they are sparsely documented or explained. ...
2
votes
2answers
1k views

How to process content in a widget? [duplicate]

Possible Duplicate: Is There A Hook To Process The Content Of The Text Widget? I have created a plugin that uses tokens in the body content to dynamically insert certain content. For ...
2
votes
2answers
580 views

Categories lose hierarchy order once assigned to post

I setup some hierarchical categories and when I assign them to a post the widget reflows and loses the hierarchy display. Example: - Education Services -- Arts & Archives --- Fine Arts -- ...
2
votes
2answers
1k views

How to pass custom options from widget form to widget update callback?

I've added a few checkbox options to the default widget form. But I'm stuck on how to access these option states and pass them along during the widget save event (widget_update_callback) so that they ...
2
votes
1answer
161 views

Broken markup when using the_excerpt() in a widget?

The text returned by the_excerpt() does not respect my widget format. I couldn't explain it better so I will just show you my code: function widget($args, $options) { extract($args); ...
2
votes
1answer
777 views

Duplicate and change a Theme Widget

Is there a way (a common one) to duplicate and change a theme widget ? I'm asking this because, I have this widget that displays the recent news and if we click, it will display ALL news, but I wish ...
2
votes
1answer
34 views

Are there plugins that interfere with the admin part of Rss widget?

I've been using the Rss widget in my site, and suddenly a few days ago, the admin part stopped responding. That is, I'd change the link to the Rss and it wouldn't get saved (and therefore would show ...
2
votes
2answers
2k views

How to create a widget that has a submit form in the front end

How to create a widget that has a submit form in the front end? The reason for this is I'm teaching myself plugin development and I'm struggling on how to display a form on the front end after adding ...
2
votes
1answer
2k views

Creating a admin widget for /wp-admin/post.php?

Hello and thank you for helping in advance, I am trying to create a widget that lives inside the post.php page for when editing a post that exists (Not new-post.php, I need an ID). This custom ...