Widgets are configurable elements used to dynamically build sections of a WordPress theme.
3
votes
2answers
985 views
Need to create a Theme demo site that features multiple themes
I would like to create a site like: http://demo2.woothemes.com/?name=sentient for my clients, so that they can see the range of themes I offer. I own many templates from different providers, and ...
3
votes
3answers
523 views
Widget development - Drop down options won't save
So, i successfully managed to add a drop down option, the problem is when i click save all of the options are removed, however the chosen option is implemented successfully.
Here is the relevant ...
3
votes
1answer
446 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 ...
3
votes
2answers
110 views
How to add color picker to widgets?
I have some problems adding the wpColorPicker to a Widget. Does anyone have a working sample? It only works when I click on 'Save' or reload the page, but when I drag a new widget to the area it will ...
3
votes
1answer
109 views
What is this instance variable doing in the Widgets class
The lack of documentation for the WP_Widget class is driving me mad. Here is what I have salvaged off the codex:
public function form($instance){
?>
<label for="<?php ...
3
votes
1answer
401 views
Problems with the sidebar args and wp_list_bookmarks
I have run into an issue trying to use the sidebar args (before_widget,after widget,after_widget,before_widget) as theme style friendly parameters for the function wp_list_bookmarks, that is that the ...
3
votes
2answers
244 views
Get page IDs based on which template they are using?
I have a situation where I need to provide a dropdown of pages in a widget, based on whether they are using a specific template. In other words, for all pages using template 'Foo', get the post ID.
...
3
votes
1answer
240 views
Help adding image upload functionality to widget
I am working on a small WordPress widget and I am trying to set it up where the user can upload an image. So far, the necessary scripts are loading but when I click the "Media Library Image" button ...
3
votes
1answer
109 views
Using preg_replace to clean widget output HTML
I am working on a wordpress site that uses a plugin / sidebar widget. The issue I am experiencing is that the widget generates HTML that is not valid, an example of this is below...
<p>
...
3
votes
1answer
44 views
When to use which plugin output method?
I'm a Drupal dev, getting into Wordpress. So far as I can tell there are a few different methods by which a plugin can output content on to a Wordpress site:
Shortcode
Rewrite API
Widget API
...
3
votes
1answer
85 views
Determining a Widget Instance and Sidebar Location?
When using the filter:
add_filter('widget_display_callback', 'function_name');
function function_name($instance) {
/* Some Code */
return $instance;
}
Is it possible to determine the sidebar ...
3
votes
1answer
406 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
187 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
371 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
2k 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
737 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
136 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
2answers
217 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
1answer
127 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
2k 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
527 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 ...
3
votes
7answers
7k views
How can I add links to widget titles?
I'm using three widgets, two of them are default WP widgets (Recent Posts and Archives) and the third one is a custom widget which acts like Recent Posts but for a specific custom Post Type.
My ...
2
votes
3answers
285 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
664 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
214 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
3answers
169 views
link wordpress and stackoverflow
how do i link stackoverflow widget in wordpress to my profile in stackoverflow to show badges, reputaions ??
2
votes
2answers
451 views
Is There A Hook To Process The Content Of The Text Widget?
Is there any filter which can be used in a plugin to process the content of the text widget before it is rendered?
2
votes
3answers
237 views
How to add a specific widget to only 1 page?
I would like to show a widget in only one page of my site, as i can see it is not possible right?
Should i add that for all my site pages or not?
2
votes
2answers
304 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
438 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 ...
2
votes
1answer
52 views
register sidebars
i registered my sidebars as follows:
$sidebars = array (
'sidebar-10' => 'Hoof Sidebar',
'sidebar-11' => 'Tuisbladsy area een',
'sidebar-12' ...
2
votes
1answer
100 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
2answers
204 views
Add New Footer Widget Area with Limited Options?
I'm trying to add a new footer widget area to my theme. I was able to add the new footer widget area and it works correctly. But I would like to limit what can be done with the widget area by the end ...
2
votes
2answers
186 views
How To Determine If A Filter Is Called In A Sidebar/Widget Context?
So I have a plugin that appends or prepends an enhanced author biography to the content of a page/post/custom post type.
It does this by hooking to either the_content or the_excerpt and ...
2
votes
3answers
642 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
1answer
3k views
Can I create my own “Recent Posts” widget or customize the existing one?
I'd like to enable the Recent posts widget with the ability to show a "View All" link when there are more posts than I've currently got the widget set to show.
I'd also like to be able to exclude ...
2
votes
2answers
2k 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
488 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
265 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
1answer
732 views
Switching themes without losing widgets?
The other day, I switched from 2010 default them to Semiologic, then back. When back to the 2010, all my appearance/widgets had gone back to the default.
Does this often happen? What is the best ...
2
votes
1answer
283 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
175 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
2answers
40 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
660 views
Add a custom walkter to a menu created in a widget
I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu ...
2
votes
2answers
915 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
2answers
73 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
656 views
how to edit widgets in wordpress
In the dashboard -> appearance -> widgets there is a list of widgets that you can drag and drop to show in the sidebar.
Where is the html/php code for these custom widgets?
I've been on wp function ...
2
votes
1answer
688 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
2answers
189 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 ...