0
votes
1answer
62 views

Using a multiple <select> element in widget form

I am trying to save all of the options in a <select> element in a widget. So far I have the following PHP code for the form: public function form( $instance ) { // Code for editing/adding ...
-1
votes
0answers
10 views

Dynamic widget area creation from repeater option value [closed]

This is how I am getting repeater value foreach($angon['multi-text'] as $value) { echo '"'.$value.'",'; } Now I want to register sidebar with this values.The method to do so ...
0
votes
0answers
12 views

Group multiple widgets in one

Is that possible to group some widget into one. I am creating some similar widgets and I want to group them altogether. Like I want to name it "Widget Group" and when I activate "Widget Group" plugin, ...
0
votes
0answers
27 views

Populating a list of IDs for a widget to use in WordPress

I am trying to create a widget that takes a list of user-given IDs for items and then displays them at random wherever the Widget is placed. So far I have the following set up: User enters an ID in ...
2
votes
1answer
47 views

How do I add a widget programmatically to a newly created site (WPMU) within a plugin?

I'm making a plugin that creates new sites (WPMU), and also has its own widget that needs to be placed onto the new sites it creates. The issue I'm having is that I can't get the plugin to insert ...
0
votes
0answers
16 views

Can you create your own widgets and use them for editable areas of client content?

I'm relatively new to WordPress. As a content management system I chose WordPress so that I could design a website for a friend in a way that would be easy for them to use when I had handed it over. ...
0
votes
0answers
21 views

Widget options are not updated

I'm creating a plugin which creates a widget with some options. I've extended the WP_Widget class: class Dynamic_Player_Widget extends WP_Widget { function Dynamic_Player_Widget() { ...
0
votes
0answers
21 views

Show sidebar from custom meta value

I want to show sidebar from meta value.Basically I am using wp-page-widget.Now I want to show the active widget.Since I am working on one page template so general procedure will not work. Upon ...
0
votes
0answers
71 views

Dynamic css for a widget plugin

I have a plugin that creates a widget to show latest posts and I would like to add a dynamic css file to style the post title without using inline styles. So for example i have public function ...
0
votes
0answers
18 views

How to include WP_Widget from another file in main plugin file?

I tried to use the code bellow in my main file: define( 'MYPLUGINNAME_PATH', plugin_dir_path(__FILE__) ); include MYPLUGINNAME_PATH . 'class/class-widget.php'; Then I have a file ...
0
votes
1answer
32 views

How to set the default value as the saved value once a form of widget is saved?

I tried doing this for the function form : <?php function form(){ //Set up some default widget settings. $defaults = array( 'uid' => __('121232', 'example'), 'height' => ...
0
votes
0answers
40 views

wp_register_sidebar_widget in loop within a plugin?

I'm trying to dynamically create widgets based on a posts from a post type. The code is as below. This function is pulled from my plugin class: public function initWidgets() { // Config ...
2
votes
1answer
54 views

Tips for targeting widget dragable for WP Pointer on widgets.php page

I'm updating a widget plugin I wrote called Feature Me and am adding in WordPress pointers for first time users to help them find the widget after installing the plugin. However, I have come across a ...
-1
votes
1answer
26 views

What can I do to customize a widget provided with this plugin? from where have I to start?

I am using this WordPress plugin to create an immage gallery: http://wordpress.org/plugins/easy-media-gallery/ This plugin provide a single widget inside it and I would customize some litle function ...
1
vote
1answer
58 views

Why does my widget break other widgets?

So this widget i created is killing all other widgets registered in the same sidebar. Meaning, nothing renders after this widget does. No other widget markup makes it to the DOM. After hours of hair ...
0
votes
1answer
335 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
77 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
0answers
20 views

grouping my widgets wordpress

In the widgets page, there are two boxes "Available Widgets" and "Inactive Widgets". How can I add a new boxe with my custom name where I can group all my widgets.
0
votes
0answers
33 views

Get fields of a widget

I have a widget that has fields, so how can I get these fields in my Metabox. I have tried with this variable $wp_registered_widgets, but I can't get the fields. Is there any solution for my ...
0
votes
1answer
51 views

My widget won't update its values when save is clicked

So this is my first attempt a creating a widget that has a functionality of creating a simple image rollover effect (if anyone wants it when it's done, leave me a message). Now I downloaded a sample ...
0
votes
1answer
79 views

Passing $this->get_field_name() to javascript

I've tried doing this one of two ways: In the form method of my Widget class (which extends WP_Widget), I have the following snippet, which sets a global javascript variable: if( $instance ) : ...
0
votes
1answer
92 views

Wordpress Widget - Saving multidimensional arrays into $instance

In my wp widget, $instance has an attribute called order which will the listing order of libraries/services. I'd like to store a multidimensional associative array that will hold the id of each ...
0
votes
1answer
52 views

Wordpress dynamic widget by location?

i need to show the widget based on user location , for a testing purpose i have created the by using following code if( function_exists( 'register_sidebar' ) ) register_sidebar( array( ...
0
votes
2answers
33 views

Are there any official or unofficial guidelines for the styling of a widget?

I've designed a sidebar widget and found that on many themes the widget looks fine. However, certain themes make the widget look out of place (clashing with colors, bad contrast, etc.) Are there any ...
-1
votes
1answer
187 views

Can I use a form in a dashboard widget?

I'm building a plugin and would like to add a dashboard widget with a custom form. In this form, users should be able to edit a list of strings (add, edit and remove items). Is there a WordPress API ...
0
votes
2answers
139 views

Widget redirecting to home page

Am trying to create a widget that searches for names. The searching and all that is fine, but when I hit submit, I get returned to the front page. I tried messing with the action="", but no matter ...
1
vote
1answer
30 views

Archive - same title for the first two posts

I created an archive page called archive.php Here I include header / footer and this code: <?php if (have_posts()) : while (have_posts()) : ?> <h1 class="entry-title"><a ...
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 ...
0
votes
1answer
100 views

Wordpress plugin not eching popular posts

I created a plugin in wordpress to show popular posts, but this is not returning the post and number of comments properly. Even I have comments in my post(approved as well, so this is not the case) ...
1
vote
2answers
309 views

Sidebar widget to show popular post not working?

This is the code to display popular post on front end, however the problem is the data is not saving from the back end. Like i want to show only 3 popular posts on front-end so i select the option 3 ...
6
votes
2answers
768 views

What is the correct way to build a widget using OOP

I am working on a simple search form widget, with a built in autocomplete capability (You can download the current version here). The plugin is working, but I am currently rewriting all the code using ...
0
votes
1answer
74 views

Can / should a widget plugin define its own Widget Area?

Should a plugin be able to add a widget area above the_content? (Without requiring template/theme changes.) What would be the best way to do this? Doubts: widgets typically echo output to the screen; ...
0
votes
1answer
720 views

Widget update function not saving values

Hello WordPress Answers! I'm having trouble with the widget update function saving values correctly, but first let me explain the situation. I'm writing a simple news ticker widget plugin, which ...
28
votes
4answers
6k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
0
votes
1answer
137 views

How do I create Widget within plugin that uses its own class?

I wrote WordPress plugin and want to include 2 extra Widgets with it... if( !class_exists('plugin_name') ) { class plugin_name { // plugin code } } // include widgets code ...
0
votes
1answer
117 views

Best practice to include custom user styles in widgets

What's the best way to include custom user styles in widgets? For example adjust colors for buttons, borders etc. without having the user to develop a complete new stylesheet.
0
votes
1answer
218 views

Create Widget or Enable Shortcodes in Sidebar

I'm well aware that WordPress by default does not process shortcodes in the sidebar. My question is why. I'm building a very small plugin that exports some content when the shortcode is present. This ...
3
votes
1answer
651 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
157 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> ...
1
vote
1answer
1k views

How do I register a stylesheet inside a WordPress widget?

I'm developing a WordPress widget following Dave Clements tutorial. It works well. Now I want to add some styles to it. I want the styles to be in an extra css file which will be loaded during ...
12
votes
2answers
660 views

Conditionally enqueue a widget's script/stylesheet in HEAD (only when present on page!)

I've been trying to load scripts and styles for a WordPress widget with the following conditions... The scripts MUST load in the HEAD (else they break). The scripts must ONLY load when the widget ...
2
votes
2answers
211 views

Dynamic content in a widget

I have to make a widget from where the user will be able to add a few images and then I will show only some of them, randomly, and it will be automatically changed on page refresh. The problem is that ...
2
votes
2answers
85 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 ...
1
vote
2answers
861 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 ...
4
votes
3answers
1k 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 ...
0
votes
2answers
2k views

How to exclude categories from get_categories() select list inside a widget admin panel

I have a widget that I need to add a category select list to. The end user should be able to select a category and I need to save the category ID with the widget. I've hit a stumbling block in that I ...
2
votes
1answer
487 views

Edit the output of wp_widget_rss_output()

I want to show rss feed in my dashboard widget, i use this code: wp_widget_rss_output(array( 'url' => 'http://www.example.com/', 'title' => __( 'Some Title' ), ...
4
votes
3answers
1k views

Has anyone managed to integrate the wp_editor inside a widget?

Adding this in the widget form method: wp_editor($text, $this->get_field_id('text')); seems to work. But after you press the "Save" button the widget goes funky... Adding ...
0
votes
2answers
165 views

How to add captcha to publish widget

I want to add a captcha challenge to the "publish post" widget in "add new post" to prevent spam posts. This is because my site is open to registrations and posting. Could someone please suggest how ...
0
votes
1answer
54 views

Widget internal hooks and functions

I am working on my 1st plugin, of some ideas to re-do the interface to how widget's are manage d and organized. Anyhow. I am struggling to get this information, either that or understand it. Create ...