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

learn more… | top users | synonyms (1)

2
votes
0answers
34 views

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(){ ...
2
votes
1answer
116 views

Trying to wrap <span> around first word of multiple word strings with a widget_title() filter, only works on two word strings and not more than two

I am trying to wrap a around the first word of multiple word widget titles. I have used the answer from here: ...
2
votes
2answers
214 views

javaScript in <head> section of WP API

How do I place the following javaScript in the <head> section of the Wordpress Widgets API menu screen? <script type="text/javascript"> jQuery(window).load(function() { ...
2
votes
1answer
307 views

How do I rebind event after widget save

I am writing a widget who's form elements have a click event attached to. I bind it using jQuery. However, after clicking save, the bindings gets lost. That is, clicking those elements doesn't ...
2
votes
1answer
78 views

add widgets to dashboard for easy access for clients?

I have a widget created: if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Featured Video', 'before_widget' => '', 'after_widget' => '', ...
2
votes
2answers
1k views

Customizing Default Categories Widget

I am trying to hack the default categories widget from wordpress. I have the categories displaying the way I want but I am having trouble editing the output. The widget shows the number of posts in ...
2
votes
1answer
525 views

wp_count_posts, wp_count_terms and wp_count_comments for specific user?

Is there a way for the functions wp_count_posts, wp_count_terms and wp_count_comments to return their results only for a specific user, possibly by using a user's ID? I'm making a custom "Right Now" ...
2
votes
2answers
467 views

Widgets not expanding on wordpress 3.3 widget dashbord

I updated to WordPress 3.3 (manual update) and cleaned browser cache. Widgets dashbord stop working when tring to expand dynamic sidebars for custom theme when it works for previous wordpress 3.2 ...
2
votes
3answers
1k views

How do I create a widget that only allows a single instance?

How do I create a widget that only allows a single instance of a widget to be added through the Wordpress interface? The default behaviour of widgets allows multiple instances to be added. I am ...
2
votes
1answer
1k views

Include custom post types in categories widget

So I got a fairly simple setup, one CPT with the default category and post_tag as taxonomies. Say I have 1 post and 1 CPT entry assigned to the same category. I need this to be reflected inside the ...
2
votes
0answers
91 views

Insert widgets after theme installation [duplicate]

Possible Duplicate: Install widget on plugin activation Programmatically add widgets to sidebars I'm creating a theme and after the installation it is need put the widgets. Exists any way ...
2
votes
1answer
315 views

How to determine if post has widget content?

I've got a registered sidebar called "my-header" that affects the absolute positioning of elements below it in the markup. So I need to execute a query in header.php to determine if the sidebar is ...
2
votes
2answers
1k views

How to automatically register widgets on new blog?

Is there a way to automatically register widgets when a new site is registered with a multi site setup? E.g. inside wpmu_new_blog?
1
vote
3answers
11k views

How do register_sidebar() and get_sidebar() work together?

Disclaimer: I am brand spanking new to WP. I am using the Starkers HTML5 framework theme. In the functions.php I see this code: function starkers_widgets_init() { // Area 1, located at the top ...
1
vote
2answers
163 views

How to put Stack Exchange Flair as widget?

I want to put my flair in as a widget in the top of my sidebar in my blog. There was a similar question asked here but the only answer links to the flair page and suggests copying and pasting the html ...
1
vote
5answers
210 views

Dynamic widgets

In wordpress is it possible to have different widgets on different pages, I mean, I am having a form widget which has to be just displayed on posts page, it should just display on single.php Is this ...
1
vote
3answers
176 views

Replace dashboard widgets with banner ad

I know it's probably not encouraged, but is there a way to replace the standard dashboard widgets (Recent Drafts, Quickpress, etc.) with a standard image banner ad? I know how to add new dashboard ...
1
vote
2answers
2k views

$post>ID displays wrong post ID

I've asked a question about listing all sub-pages before: Listing all sub-pages? But all the questions were wrong. Anyways, I have now simpler question. global $post; echo $post>ID Works ...
1
vote
2answers
794 views

How can I add an incremental class identifier to my sidebar widgets?

My sidebar widget code in functions.php looks like this... if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Home Sidebar', 'id' => 'home-sidebar-widget', ...
1
vote
3answers
1k views

Why Can't wp_editor Be Used in a Custom Widget?

I've been working on developing a plugin that adds a widget that allows you to edit the content with a wysiwyg editor. I want to use the default wordpress editor by calling wp_editor(). I've seen ...
1
vote
2answers
844 views

Using Ajax call in jQuery doesn't work in widget

So I'm in the midst of creating a new conversion widget and I'm having some trouble getting the Ajax call to work in my widget. (works perfectly outside of WordPress). The problem at the moment is ...
1
vote
2answers
1k views

cannot drag and drop widgets since wordpress 3.2.1

I recently updated my site to wordpress 3.2.1 automatically. Now I tried to manage my sidebar widgets, and noticed I can no longer drag and drop the widgets around. If I look into my browser-console, ...
1
vote
4answers
2k views

Completely disabling widgets

How do I completely remove widget support from a theme/plugin ? Like removing the appearance -> widgets page, and prevent WP from loading widget classes and all widget-related stuff.
1
vote
1answer
2k views

Remove/Add widgets from/to the Available Widgets pool

Is it possible to remove/add widgets from/to the Available Widgets pool (either by plugin or editing core files)? There are 3 widget files located at: /wp-includes/widgets.php /wp-admin/widgets.php ...
1
vote
1answer
1k views

Calling the widget id of a mult-instance widget from inside the widget?

I'm trying to output a unique widget ID inside my mult-instance widgets. So far the following hasn't worked. Is there a unique ID and how do I call it? Thanks. function widget($args, $instance) { // ...
1
vote
1answer
2k views

Is there plugin to show recent posts from one website in the widget area of another?

I would like to take the titles of recent posts or content related posts from one website and display them in the widget area of another website. I'm sure there must be a way to do this, perhaps some ...
1
vote
3answers
3k views

Adding custom html and standard widgets to sidebar

I want to add both custom html that advanced text widgets can't support and the standard sidebar widgets in the same sidebar. However, when I put a sidebar widget into the theme, it removes all the ...
1
vote
3answers
902 views

Dynamic Sidebars On Multiple Subpages

I am building a site in WordPress. It has multiple subpages, many of which require different sidebars. So, I have a widgetized theme and I have also created a few sidebar widgets. I have written a ...
1
vote
4answers
2k views

How do I stop a widget from displaying on mobile site?

On my main site I have used the search widget in the sidebar. However, the mobile theme I am using (minileven) already has a search box built into its menu bar. This results in a second search box ...
1
vote
2answers
4k views

How to add the widgets manually to the sidebar?

How can I add the widget manually in the code ?
1
vote
2answers
1k views

WordPress “include TEMPLATEPATH” or?

I built something like this: Index Container Widgets Area and I created a widget for that - Categories Widget - Index Container .php with this in: <?php include (TEMPLATEPATH . ...
1
vote
2answers
4k views

How to hack recent comments default widget?

I would like to hack the default Recent Comments widget to show also the avatar of commenter. The modification should be really easy, if I change directly the code in default-widgets.php if ( ...
1
vote
2answers
375 views

Inserting shortcode [stream /] into a Text widget

hi i'm trying to insert a short code into a Text widget but all its doing it showing the code and not processing it. <?php echo do_shortcode(' [stream embed=false share=false width=500 height=560 ...
1
vote
4answers
779 views

How Can A Widget With Only One Instance Be Defined?

How can a widget which of which only one instance can be used?
1
vote
1answer
4k views

Show Woocommerce minicart widget in checkout page sidebar? And, how to make this update secure by overriding widget?

Before asking question here I want to tell that I have already asked the question in stackoverflow and wordpress forum but have not got any answer. So finally I came here. I have installed the ...
1
vote
4answers
95 views

Displaying a widget only on long posts (over X characters)

I'm looking to display a standard wordpress widget only on posts that are over X amount of characters in length (or another method that can roughly calculate the height of of a post.) I am looking to ...
1
vote
2answers
2k views

Retrieving list of a custom post type in a widget without using WP_Query?

I'm using the following widget to retrieve a list of the custom post type jobs: class FeaturedJobsWidget extends WP_Widget { function FeaturedJobsWidget() { $widget_ops = array('classname' ...
1
vote
3answers
1k views

Insert a span inside widget title to give a different color to the second word

I'm trying to make my widget titles two-colored; the first word white and the second one yellow. I have no idea how I can insert a span before the second word of every widget title so that I can put a ...
1
vote
1answer
190 views

Why does Wordpress stores widget options in a multidimensional array?

I have a widget with 6 different options. When I use get_option, it gives me a multidimensional array, with all my options inside the inner array, like so: $options = get_option('widget_widgetname'); ...
1
vote
3answers
6k views

Woocommerce Product Category Widget - hide categories that have no products in stock [closed]

I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows ...
1
vote
2answers
42 views

Show widget when not using SSL

My wordpress site supports http and https. What I want to do is to add a widget when surfing over http that says something like "Surf this site secure" to show the visitor that I also have a secured ...
1
vote
1answer
312 views

Notice: Undefined index: filter in …wp-includes/default-widgets.php on line 382

I'm getting this message on a WP 3.2.1 install with PHP version 5.2.17 Notice: Undefined index: filter in /home/netstewp/public_html/wp-includes/default-widgets.php on line 382 Any idea why?
1
vote
2answers
506 views

Install widget on plugin activation

Anyone know any resources to help me install my widget when my plugin is activated?
1
vote
1answer
359 views

Context aware widgets. My work in progress

I'm working on a simple addition to the widget options to allow the user to set the "context" in which widgets show be shown. Here's what I've got so far, with my questions in the comments... 1) ...
1
vote
1answer
3k views

How to save WP widget instances and options

I'm a little confused about this, even though I have read all of the API and searched for hours. When I activate my plugin I add some values to the options database, e.g. add_option('code','24'); ...
1
vote
1answer
3k views

Can I ignore caching of a plugin in W3 Total Cache? [closed]

I currently have a plugin that lets me display a random post in a widget. The problem is that if I activate w3 total cache it will only display that post as long as the cache hasn't been cleared. Is ...
1
vote
2answers
6k views

Wordpress select dropdown list in widget

Ok, I'm developing my own widget and I've a HUGE problem. I don't know how to fetch and eventually save html selects value. Simple example: /* initialize TITLE */ function widget( $args, $instance ...
1
vote
1answer
480 views

A good way to add a different background image for each page?

I'm working an a Thematic child theme wherein I need to have a unique image decorating each of the site's main pages, from a pre-defined set of permanent images. It would also be ideal to have one of ...
1
vote
2answers
890 views

what is option_name on database that store the information of current initiate widget in frontend sidebar?

what is option_name on database that store the information of current initiate widget in frontend sidebar ?
1
vote
2answers
344 views

Can I remove a widget area without editing code?

I am dealing with a Wordpress setup which has 2 widget areas. One seems to be breaking the page, and I want to remove it. Here is the screenshot of my widget setup How can I remove the Main ...