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

learn more… | top users | synonyms (1)

2
votes
1answer
972 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 ...
1
vote
2answers
2k views

Including a custom post type in the Archives widget

I have a custom post type called "videos" that I want to include in the Archives widget (stock widget in the TwentyTwelve theme). It DOES already appear on the archives page, but just not in the ...
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
3answers
317 views

Widget “Save” resetting jQuery hidden fields

I have a widget plugin that I've created, that lists about 10 fieldsets. jQuery runs at the beginning and hides and fieldsets that have no values. There are also buttons that allow to "Add" and ...
6
votes
3answers
1k views

How Do I Add Custom CSS To Only Certain Widgets

I have a standard dynamic sidebar using register_sidebar and dynamic_sidebar and I need the last widget in the sidebar (which will not have a set number of widgets) to have a distinct class ...
5
votes
1answer
1k views

Adding Widget form fields dynamically

I am trying to add form field to a WordPress widget dynamically. So if the user want to add another date to an event they can click a button to get more fields. The question is: How do save newly ...
4
votes
2answers
728 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 ...
3
votes
3answers
1k 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
1answer
808 views

Manual display of widget

I currently have a widget that needs to be manually displayed on the front page. The rest of the pages it shows up in the widget sidebar, (this is accomplished with 'Widget Logic') but on the front ...
3
votes
1answer
774 views

get_intermediate_image_sizes Get the Size Names but How Do I Get the Sizes?

I'm setting up a widget that allows to add an image to a sidebar / widget area. Basically I have a dropdown that allows the user to select one of the available sizes inside the theme's functions.php ...
2
votes
2answers
239 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
148 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
501 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
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
1answer
38 views

Create variable from widget instance

Is it possible to return a widget instance into a variable or array? I'm thinking something along the lines of $widget['title'], $widget['content'] etc. I have tried inspecting the global ...
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
1answer
357 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
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 ( ...
0
votes
4answers
2k views

Programmatically Add Font-Awesome Icons to Category Widget

I use the Categories widget on my sidebar(s) and I would like to display a Font Awesome icon next to each category listed in the widget. The icon would be the same for all categories, for now, but I ...
0
votes
1answer
436 views

Jquery checkbox -show posts with checked tags

Using jquery, How do I show a checkbox with the list of tags in the sidebar, and only show posts of the checked tag? I cant seem to find this anywhere
0
votes
2answers
597 views

Possible to preset a widget's contents via a plugin script?

This plugin is a simple demo test to see if I can dynamically populate a pre-existing widget area with text. In this case, my theme has created the widget area "home-header-widget" and I'm trying to ...
5
votes
2answers
100 views

Retrieve each widget separately from a sidebar

I would like to retrieve each widget existing in a sidebar in order e.g. to mix them with posts inside the main loop. I know I can use different widget areas (sidebars) but this approach clutters the ...
5
votes
2answers
165 views

Prevent widgets removal

I'm building a site with a lot of widgets. They have been highly customized. Several admins/editors will have to edit these widgets when the site is live. Right now I'm scared to see a widget (and ...
5
votes
1answer
2k views

How display widget by id

I fetched widget id this way: $the_sidebars = wp_get_sidebars_widgets(); print_r( $the_sidebars['sidebar-1'] ); It shows: Array ( [0] => recent-posts-2 [1] => recent-comments-2 [2] ...
3
votes
1answer
399 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 ...
2
votes
2answers
235 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
2answers
739 views

Is it possible to enqueue a script from a widget method (of extended WP_Widget object)?

I am creating a widget plugin that a user could potentially use multiple iterations of the widget multiple times on a single widget-area / multiple widget-areas on a single page. Because of its ...
2
votes
2answers
287 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
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
712 views

Custom shortcode in widget forced to top of widget

A custom shortcode i made is being forced to the top of the widget outside of the widget container. Any ideas why? This is my code... function nktmediaplayer_func($atts) { ...
1
vote
2answers
92 views

Dynamically Register Sidebars For Each Top Level Page

I have a small website that wants a different sidebar for each page containing blocks of text, blocks of images, and blocks of links, etc. What I'm trying to do is register a sidebar for each top ...
1
vote
1answer
578 views

How to add class on Widget Title

This is an example of register sidebar function from codex. My focus is on the before_title argument. What i want is to add a class to the title(<h3>). From my widget code or may be pass the ...
1
vote
1answer
106 views

Remove Widgets in Dashboard

Another noob question...when authors log on and access their Dashboard, they see all sorts of widgets such as an Internet Explorer warning, news on what's going on with WordPress. Is there anyway to ...
1
vote
1answer
126 views

Char limit on custom blog-post form? [closed]

I want to setup a simple custom form for users to post, which will automatically: Subscribe user to updates (i.e. moderation approved, comment posted) Enable DISQUS xor IntenseDebate comments ...
1
vote
2answers
843 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
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

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 ...
1
vote
1answer
1k views

How do I create a drop down menu in a widget?

How do I create a simple dropdown menu with 3 options in a widget? I'm using $instance to do it. How would it look in a barebones widget?
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
2answers
221 views

Widget Area: Modify $param['xy'] from widget-$n

I have different widget areas. One is a horizontal area that may contain eg. 4 widgets next to each other. My Question is how would i add a different eg. $param['widget_title'] to widget number $n ...
1
vote
2answers
470 views

Changing widget options via the functions.php when there are no hooks

The problem: to change a widget's options with a custom function in functions.php, when there are no useful hooks, and where there are multiple occurrences of the same widget (multiwidget). This ...
0
votes
1answer
38 views

Customise search form in the Widget

I would like to customise the Search Form that you drag and drop from the widgets panel. The customisation will be more than just css changes. I would like to add and custom classes. Is this ...
0
votes
1answer
67 views

Display sidebar that created in functions.php

I'm currently using Wordpress theme for my website. Decide to create my own sidebar, but the styling of it must be remain the same one as original sidebar. I'm had create a new sidebar in ...
0
votes
2answers
144 views

Hide widget to non-logged in users without plugin (functions.php) [closed]

I am working on a Woocommerce Wordpress site. I want to hide a widget in frontend to non-logged in users. The widget is "filter by price" from Woocommerce. I'm also using the "Catalog Visibility ...
0
votes
0answers
111 views

jQuery does not work in widget backend

I created a widget which should use jQuery for switching between two views and implement the jQuery UI date picker. I was wondering why my jQuery code does not work as I noticed that the date picker ...
0
votes
1answer
295 views

Multiple entries in get_option results? or why is _multiwidget set to 1?

I am developing a wordpress widget, and need to store some user configuration values, that is why I am using wordpress update_option and get_option. I am new to widget development. I have some ...
0
votes
0answers
75 views

How to detect shortcode usage, submit a form from widget to that page?

I've created a plugin and now want to create a widget containing a form that will submit to the page where my plugin shortcode is embedded from any wordpress page on the front end. I assume that ...
0
votes
2answers
162 views

How to allow PHP In WordPress text widget

I want to add a text widget to my new WordPress website, but in the text widget there are some PHP snippets and I am finding it difficult to do it. Please help me Guys.
0
votes
1answer
160 views

display most popular tags in two columns

I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however ...
0
votes
1answer
96 views

Infinite-Scroll Plugin and Jetpack Infinite Scroll Plugin - Adding to “Thoughts” Theme

How do I enable infinite scroll (either with the infinite-scroll plugin OR the built in infinite scroll jetpack) on the "Thoughts" Wordpress theme? I'm a total noob at editing this stuff so if you ...