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

learn more… | top users | synonyms (1)

3
votes
1answer
658 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
178 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
1answer
398 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
326 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
3answers
278 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 ...
0
votes
4answers
545 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
422 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
576 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
142 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
1k 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
282 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
1answer
652 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 ...
2
votes
2answers
208 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
578 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
250 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
88 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
634 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
81 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
125 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
740 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
1answer
477 views

Using tabs in admin widgets [closed]

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 ...
1
vote
2answers
814 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
941 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
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
365 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
204 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
451 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
30 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
1answer
33 views

Themes VS Plugins [duplicate]

If I am customizing a WordPress site, should I do that via a theme or a plugin? By customization I mean: Add new custom post type Add new fields to the Users Add new widgets Add custom permalinks ...
0
votes
2answers
68 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
63 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
110 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
50 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
80 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
82 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 ...
0
votes
1answer
578 views

How to have Multiple Archives Widgets, one archive widget per category (in a different page)?

Please read the whole question before assuming this question is repeated. After one day of trying plugins and tutorials, I am convinced that there is no straightforward method of achieving what I am ...
0
votes
1answer
75 views

how to extend a WP_widget twice

Has someone ever tried to extend calss WP_Widget, then extend it again ? Having to related widgets, I tried to create the first extending WP_Widget, : class FirstWidget extends WP_Widget { public ...
0
votes
2answers
250 views

register child class in another plugin

I think this should be relatively easy, but somehow I cannot figure out how to do this. essentially there's a preexisting plugin that does this: add_action('widgets_init', create_function('', ...
0
votes
1answer
155 views

How to Get Admin Settings for a widget when using the_widget() with custom widget

I have searched around for an answer to this question and I found this: Manual display of widget which gave me a solution of: if(function_exists('the_widget')) { $instance = get_option( ...
0
votes
2answers
51 views

widgets in contacts only

I have a few pages listed in my top menu. these are: contacts, My account and messages. I have added a map to the "Pages Sidebar" tab in admin. But it seems to add the map to all 3 pages listed above ...
0
votes
1answer
63 views

Registering multiple copies of a widget

I'd like to be able to register multiple copies of the Quick Search Widget in the code below, so that I can have it multiple sidebars. The code has been taken from a plugin I've downloaded function ...
0
votes
1answer
73 views

Which file displays the date archive?

I'm building a new theme. I'm now working on to figure out which file is needed to show the "whole" post for a specific date which displays when you click on a date in the built in WordPress calendar ...
0
votes
1answer
80 views

Add individual <hx> tag to widget title in sidebar

In my sidebar every widget title is enclosed in <h2> tags. I use 4 widgets in my sidebar and I'd like to have the first 2 widget titles as <h2> and the other 2 as <h4>. I changed ...
0
votes
2answers
1k views

How do I stop out of stock items from appearing on my WooCommerce site when using the Layered Nav widget [closed]

WooCommerce includes a handy Layered Nav widget. This allows you to filter the catalog items based on attributes that you've set, including for variations of items (like different sizes.) However, if ...
0
votes
1answer
320 views

Unfiltered html in widget title not working

function update( $new_instance, $old_instance ) { if( current_user_can( 'unfiltered_html' ) ) { $new_instance['title'] = strip_tags( $new_instance['title'], ...
0
votes
1answer
101 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 ...
0
votes
1answer
90 views

Proper approach to moving complete site from one domain to another AND preserve widgets

I consider myself fairly versed in this matter, however I've recently had a rash of issues when moving sites. I am able to successfully move the site, edit wp-config.php, move the database, etc. ...
0
votes
2answers
3k views

How to add the widgets manually to the sidebar?

How can I add the widget manually in the code ?
0
votes
1answer
186 views

Best way to allow manageable social media URLS?

I am working on a site and it is possible that the site will have a number of pages which feature links to the client's social networking sites (Twitter, Facebook, LinkedIn...). Now I know that the ...