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

learn more… | top users | synonyms (1)

3
votes
1answer
793 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
1k views

Using the media uploader in a custom plugin

As part as a widget I'm creating, I need the admin to upload an image via the widgets panel I have the following code under a new class <?php function form($instance) { $instance = ...
3
votes
1answer
238 views

Calling static method in the Widget Class

I have a widget class Xwidget extends WP_Widget{ function cron_addB(){} } I want to run a cron job that calls that function from outside the class function xxx_cron_activation() { ; if ( ...
3
votes
2answers
797 views

File included into functions.php via require_once() won't echo?

I'm trying to load a file via require_once() to handle some enhanced functionality in my theme. I could place all the code directly inside functions.php, but I'm trying to isolate this code into its ...
3
votes
1answer
3k views

Embed iframe or html page into dashboard widget

I was wondering if it would be possible to embed an html page or add an iframe into a dashboard widget. I have a multi author blog and i want to make my admin section a simple as possible for some of ...
3
votes
1answer
898 views

Get the sidebar ID in which the current widget was dropped

How can I find out in which sidebar was a widget dropped? From inside that widget. More precisely from the form() function. Can I automatically remove the widget if it's not added in the appropriate ...
3
votes
2answers
141 views

Has anyone been able to get the aweber plugin to work

Aweber has a new api https://labs.aweber.com/ and based on that they have written a plugin: http://wordpress.org/extend/plugins/aweber-web-form-widget/ for WordPress that adds a widget. In my testing ...
3
votes
1answer
4k views

Create a Widget Area in the Navigation Bar for the Genesis Theme Framework?

(Moderator's note: The original title was "How can I create a widget area in the navigation bar (Genesis specific)?"( I'm trying to create a widget area in my navigation bar. I'm attempting to adapt ...
3
votes
2answers
469 views

Create More Widget Holders Like Active Widgets and Inactive Widgets

I am wondering if it is possible to create other Widget Holding sections like Active Widgets and Inactive Widgets. For instance, perhaps I would create a Media Widgets section and place all media ...
3
votes
2answers
176 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) ...
3
votes
1answer
277 views

Sidebar Widget Registration without a name, how is it assigned to new named sidebar widget?

In my current theme version, I'm registering sidebars with names. However, in previous versions, I only had one sidebar and registered it without a name like so... if ( ...
3
votes
2answers
830 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 ...
2
votes
6answers
6k views

Including Custom Post Types in “Recent Posts” Widget

I'm able to easily include my custom post types into my main loop by making small adjustments with query_posts(), but I'm not sure how I would go about including custom post types in the "Recent ...
2
votes
2answers
6k views

Code for Recent Posts Widget

I want to make changes to code of the Recent Posts widget – could anyone please tell me where that code is located? Thank you in advance!
2
votes
3answers
363 views

Why use widgets?

I am very new to using WordPress and I was wondering what the benefits of using widgets is? Looking here it sounds like they are for people who are not programmers that want to add plugins to their ...
2
votes
3answers
1k views

How to add a description to Widgets?

The codex doesn't seem to say how one would go about adding a description to a custom widget registered with wp_register_sidebar_widget(). The default description seems to be the name of teh widget ...
2
votes
2answers
758 views

What is the most efficient method for loading widgets in functions.php

I have seen WordPress developers use two different methods for loading custom widgets from the functions.php file. The first: include("functions/my-custom-widget.php"); The second: ...
2
votes
2answers
4k 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 ...
2
votes
3answers
200 views

link wordpress and stackoverflow

how do i link stackoverflow widget in wordpress to my profile in stackoverflow to show badges, reputaions ??
2
votes
1answer
806 views

register_sidebar ignores 'id' and 'class'

I am using the following to register a widget area: if ( function_exists('register_sidebar') ) register_sidebar( array( 'name' => __( 'Footer Widgets', 'hex'), 'id' => ...
2
votes
2answers
2k views

Shortcode from a widget is wrapped in unwanted <p> element

I'm using Black Studio TinyMCE Widget as a rich text editor widget. In a sidebar I inserted the TinyMCE widget with a [testimonial] shortcode and some content after it. For example: [testimonial] ...
2
votes
1answer
702 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) { ...
2
votes
2answers
574 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?
2
votes
1answer
202 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, ...
2
votes
1answer
159 views

register sidebars

i registered my sidebars as follows: $sidebars = array ( 'sidebar-10' => 'Hoof Sidebar', 'sidebar-11' => 'Tuisbladsy area een', 'sidebar-12' ...
2
votes
2answers
303 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
1answer
306 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 ...
2
votes
3answers
2k views

Role that can edit only widgets, not other theme options

How could I make particular role access widgets administration menu (wp-admin/widgets.php), but not access other theme administration menu elements. I have got that far as to display Appearance menu ...
2
votes
2answers
1k views

How wp_cache is supposed to work, and does it help with performance?

I was coding my recent comments widget, and using $wpdb->get_results and I wanted t use cache so it doesn't perform the query every time the page loads, so I used: $comments = ...
2
votes
2answers
1k 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
136 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
1k 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
3answers
1k views

How to determine the current widget's parent container (sidebar widget id)

I have several custom widgets that are installed as part of my theme. I'd like to execute conditional code inside each widget's admin panel (not the public side, I'm just interested in the admin panel ...
2
votes
1answer
359 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
784 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
353 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
181 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
52 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
2answers
3k views

Where to find the source code of a widget?

i would like to find the source code of the widgets, would you know where to find them? I found the class WP_Widget, but i would like to find, for example, the widget with the last articles. Thanks
2
votes
1answer
397 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
84 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
283 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
550 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
422 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
832 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
2answers
1k 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
7k 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
1k 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
966 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
1answer
2k 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 ...