Tagged Questions

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

learn more… | top users | synonyms (1)

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

Print owned created widget

Im trying to print my own created widget with the following function: the_widget(); The widget is defined with the following values: $this->WP_Widget('openingHours', 'Opening', $widget_ops, ...
0
votes
2answers
271 views

jQuery UI inside widget on admin page

I have created a widget that has quite a few settings, and so I am trying to create a tabbed menu (using jQuery UI) inside the widget settings of the admin page. The problem is basically that tabs ...
1
vote
1answer
474 views

How to remove the parentheses from the category widget

In the default category widget, when you check the "show posts count" checkbox, the number of posts appear surrounded by parentheses, how to remove them.
-1
votes
1answer
81 views

jQuery “on” handler does not fire on newly inserted widgets [closed]

I have a jQuery script attached to the widget.php page via an add_action('admin_footer') call. The jQuery executes fine on widget items that were in place when the page loaded. However, on newly ...
0
votes
1answer
118 views

Putting a wordpress custom post into a widget

I have just recently created a widget in my Wordpress theme that inserts a widget into the sidebar. Its based upon the text widget. However the html content is hard coded into the widget and it has ...
0
votes
1answer
73 views

New loop vs widget

So, I have a sidebar that I'm going to list all posts in, I could just use a widget. But is it proper to use a new loop instead of a widget, or preferential?
0
votes
1answer
423 views

Plugin won't activate, fatal error (widget class not found)

I've been putting together a simple WordPress plugin that employs a sidebar widget and shortcode. One user has reported the following error when trying to activate the plugin on their local WP ...
0
votes
1answer
253 views

Saving widget gets an undefined variable

I am developing a widget for cached feeds. The widget itself works exactly as I want but I noticed that if I were to delete the widget and then add a new one (or simply just add a new one) on the ...
1
vote
0answers
31 views

Adding custom menu widget to sidebar programatically [duplicate]

I am trying to add custom menu widget to the sidebar. I am not working on wordpress directly, but I am using an xml-rpc calls to manage worpdress site (it is possible via ...
0
votes
1answer
227 views

WAMP to XAMPP WordPress transfer

I want to switch a WordPress site from a wamp localhost to xampp localhost. Using the Tools > Export, I saved the WordPress content to an XML file. I did not create a similar backup of the MySQL ...
0
votes
1answer
39 views

WordPress function breaks widget's markup?

Here's a standard function creating widget, it displays Widget's title and echoes "test" below it: function widget( $args, $instance ) { extract( $args ); $title = ...
1
vote
1answer
602 views

Add tinymce to widget textareas

I've got several custom widgets which are extended from WP_widget. Many of these have textarea fields. I'd like to be able to apply a special css class to certain of these textareas in order to ...
0
votes
1answer
90 views

Problem with single posts not showing correct category sidebar

I'm looking for something very specific: I'm using a plugin called "Category and Tag Specific Widgets" to create category-specific html in the sidebar of each category. This only works if I click on ...
0
votes
1answer
27 views

prevent custom widget file names from showing in Appearance > Editor

I've setup a few custom widgets for my theme, and when I go into Appearance > Editor, the widget file names are showing up in the list of files that can be edited. How can I prevent these widget file ...
0
votes
1answer
415 views

wordpress widgets screen disappeared

Im having a weird problem. The screen where you manage widgets (drag and drop them from left to right) suddenly disappeared. How can I access it? It should be accessible via admin>themes>widgets but ...
0
votes
2answers
180 views

Add html after the first widget in a sidebar

Just wondering is it possible to add HTML code after the fisrt widget in a sidebar so that it would only show once and not repeat after a second or third widget is added? This is what I have so far: ...
-1
votes
1answer
74 views

Widget logic not working

I am using the Widget Logic plugin to display a widget only on certain pages. I use the condition is_page(10,16,19) to specify the pages I want the widget to display on. However, the widget does ...
2
votes
1answer
75 views

How to determine which registered sidebar area a custom widget is loaded into

I have a custom widget that I want to apply conditional logic to, depending on its parent sidebar's registered ID. For example, my theme has 6 registered sidebar widget areas. I have a custom widget ...
0
votes
1answer
47 views

Accessing widget information

I'm trying to access widget information saved in the wp_options table. I printed it out: add_filter('the_content', function(){ $res = get_option('widget_my_widget'); print_r($res); }); And ...
0
votes
1answer
316 views

twenty twelve theme widgets not working

For both Twenty Twelve 1.1 and a child theme based on Twenty Twelve, widgets cannot be added. If I go to appearance > widgets, there is no widget area to drag widgets into. I have reinstalled the ...
1
vote
3answers
260 views

Displaying a widget in sidebar only when no other widgets rendered?

I am working on a custom theme, basically migrating a current sites look and feel into WordPress. Most of everything is based on Pages, and all of these pages should have a left sidebar. Of those ...
0
votes
1answer
101 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
1answer
821 views

How to create a 'single' category widget for woocommerce plugin [closed]

Woocommerce out of the box provides many widgets, however the category widget for providing a product search, groups ALL the categories into one widget. I want a widget for one category, i.e. 'shop ...
0
votes
1answer
186 views

Custom tabs widget don't work in google chrome, is blocked, do not change the tabs. Why?

Code is the problem or is a Google Chrome issue? Here is the code: /*-----------------------------------------------------------------------------------*/ /* Create the widget ...
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 ...
2
votes
2answers
485 views

Reorder dashboard widgets

I recently tried to reorder the dashboard widgets by writing a plugin. I accomplished this: with the following code: <?php /* * Plugin Name: Custom Dashboard * Description: Custom dashboard ...
1
vote
3answers
1k views

Insert a span inside widget title to give a different color to the second word

I'm trying to make my widget titles two-colored; the first word white and the second one yellow. I have no idea how I can insert a span before the second word of every widget title so that I can put a ...
-1
votes
1answer
3k views

Create a simple widget

I wanna create a simple widget that show an image and text with a link. Something like this: http://jsfiddle.net/aF4UR/ But I want to include this as a widget with fields. For example in the back ...
1
vote
1answer
413 views

remove post and categories/tags count from right now dashboard widget

I know it is easily possible to add a post-type count for a custom post type to the right now dashboard widget. However I wonder if it is also possible to remove stuff from this widget. E.g. I ...
0
votes
2answers
94 views

Multiple widgets in wordpress

I have created a wordpress widget. It has a drop down in widget options. The dropdown contains "facebook" and "twitter". If admin selects "twitter", then twitter follower count is displayed inside the ...
1
vote
2answers
321 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 ...
0
votes
1answer
81 views

Trouble accessing a multidimensional array to add classes to default WordPress widgets

I've been writing up a function to assign classes to default WordPress widgets that I choose. After a bunch of research and modifications, I came up with the function below. A quick explanation of ...
0
votes
1answer
64 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 ...
-1
votes
1answer
892 views

How can I add multiple content-editable blocks without a plug-in?

I'm using WP as a CMS, not a blog. I have a lot of pages (not posts) that need to have different content per page in the sidebar. The content (html, images, php) in the sidebar will be different ...
1
vote
1answer
195 views

Why does Wordpress stores widget options in a multidimensional array?

I have a widget with 6 different options. When I use get_option, it gives me a multidimensional array, with all my options inside the inner array, like so: $options = get_option('widget_widgetname'); ...
0
votes
1answer
38 views

Stuck with sidebar registering

I tried to add a custom page to my Wordpress template. That part is good. What I´m stuck with is a common sidebar that appears although I registered a custom sidebar for it. I am calling the ...
0
votes
1answer
115 views

Passing widget options to external script

I am trying to pass some widget options to an external script using wp_localize_script. I know how to pass the variables and how to use them within the script, but how do I extract the widget options ...
6
votes
2answers
830 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
2answers
312 views

Transform php code into a widget?

how can I create a widget out of a php code? It's just a disqus code that I would like to place in the sidebar. I could just paste the code in the widget section (my tag), but then I would not be ...
-2
votes
1answer
97 views

Integrate comment system in the sidebar?

I would like the comments of a post and the comment box to appear in the sidebar. How can I do that?
1
vote
1answer
110 views

How to create a dashboard widget for one user

I will start by warning you that my programming skill is limited. I need to create a dashboard widget that will display in the WP dashboard for the users with the user_id=21. So far I have tried the ...
2
votes
1answer
416 views

Make compatible custom menu widget for Twitter Bootstrap

If I configure wp_nav_menu function, I can put the "items_wrap" option to achieve a nice navigation given by Twitter Bootstrap, thus: <ul class="nav nav-pills">%3$s</ul>. But, how to ...
0
votes
1answer
83 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 ...
2
votes
1answer
331 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 ...
0
votes
0answers
15 views

Widget for Sitewide Editable Content? [duplicate]

Possible Duplicate: Add New Footer Widget Area with Limited Options? I have a banner and a footer that I need to be editable, but I'm not sure if a widget is the best way to accomplish ...
3
votes
3answers
7k 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?
3
votes
2answers
320 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 ...
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
165 views

Problem since update 3.5 [duplicate]

Possible Duplicate: Stackoverflow type of badge plugin giving warnings in Wordpress 3.5 I have updated my wordpress website simpliblog.org 2 days ago. And now I can read that on top: ...