Tagged Questions

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

learn more… | top users | synonyms (1)

0
votes
1answer
83 views

how to use get_field_name in external ajax handler

I am loading new form fields from Ajax when I click on radio button in my custom widget. In Ajax callback handler, I need to use get_field_name and get_field_id widget class methods. get_field_name ...
0
votes
0answers
26 views

How to add rewrite rules adjust to permalink structure

I want to create an Archive Widget for Custom Post Type (product). I let my client to change permalink structure by himself. So, my question is: how to add rewrite rules adjust to permalink ...
1
vote
1answer
45 views

Why use dynamic_sidebar() conditionally?

In the codex example of displaying sidebars, what is the significance of the conditional wrapping around the call to dynamic_sidebar? Why do this: <?php if ( ...
0
votes
0answers
275 views

Using javascript on the new widget preview / customizer page

Widget customizer has just become core in WordPress 3.9. I'm trying out the beta version hoping to get widgets working on the customize screen in the same way I have on the ordinary widgets page. Some ...
1
vote
1answer
120 views

How to add a text widget during theme activation

I'm trying to add a text widget with the title and text set, to two custom sidebars in my custom theme. But, I can't find a clear walkthrough of how to do it. I've seen bits of code here and there, ...
0
votes
1answer
103 views

Use of apply_filter in plugin/widget class

I'm having difficulties to find out what I'm doing wrong in my use of apply_filter() in a widget class. Here's some samples of my code: class Byad_CountDown_Widget extends WP_Widget { function ...
6
votes
3answers
294 views

Author template, filter sidebar widgets by author?

I'd like to be able to filter my sidebar widgets (tag cloud, category, archive) to only show those tags/categories/months that apply to a given author on the author template. What is the correct way ...
0
votes
0answers
44 views

Customize Dashboard Widgets Area for the Client?

To avoid the client messing up the website I have already customized other parts of the admin backend, now for the dashboard widgets area. I don’t want to block access but rather I want to give the ...
0
votes
0answers
23 views

Disable wordpress widget automatically on error

I have a small widget which gets some information from other websites. Now, at times it is possible that these other websites are not available. Is it possible to disable or hide a widget ...
1
vote
1answer
52 views

How can I whitelist only specific shortcodes for processing in text widgets?

I know that I can use the following filters to enable processing of shortcodes in Text Widgets: add_filter( 'widget_text', 'shortcode_unautop'); add_filter( 'widget_text', 'do_shortcode'); How can ...
0
votes
0answers
44 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 ...
0
votes
1answer
395 views

Correct code to use php in text widget

This code is used to display php inside a text widget add_filter('widget_text','execute_php',100); function execute_php($html){ if(strpos($html,"<"."?php")!==false){ ...
0
votes
1answer
33 views

What's the right way to share data between widgets?

I've got a few custom widgets in my site, which I'm targeting to specific tags. There may be a case where there may be an overlap in widget targeting, and the desirable behaviour may be to only show ...
0
votes
1answer
28 views

if is within sidebar [duplicate]

I have several sidebars (more then 1 on a page) and I would like to set different image sizes to widgets, depending in which sidebar they are located. I tried if( ! dynamic_sidebar('my-sidebar') ) : ...
0
votes
1answer
36 views

Creating a Playlist of Widgets

I'm trying to create a specialized theme that would enable users to show a playlist of widgets in their sidebar. By playlist, I mean that each widget in the sidebar would follow a specific schedule. ...
0
votes
1answer
71 views

Add custom class to a tags [closed]

I want to create a plugin that adds specific class to all a tags.
2
votes
1answer
56 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 ...
0
votes
1answer
213 views

Insert custom content before widget title/after widget opening tag

I am trying to target a widget with a specific class, and place something directly after the opening tag or before the widget title. This: <widget> <h3>Title</h3> <p>Some ...
0
votes
2answers
30 views

Can I add a widget to the <head> of my site?

I need to add a small bit of JavaScript to the <head> section of my site (on every page). I thought Widgets would cover this but I am only able to add widgets to the sidebar and nowhere else. ...
0
votes
0answers
29 views

Search form is not working in live site

I have installed a wordpress theme called suffusion. Search widget is not working in this theme. It shows nothing found always. I have search.php as below. It is working in local machine <?php ...
0
votes
0answers
118 views

how to override menu widget?

I would like to customize the menu widget in sense to add some classes which would make it responsive. How do I override the default widget for menus? I use a custom template which supports bootstrap ...
0
votes
2answers
697 views

Post-specific widgets in Wordpress 'Twenty Fourteen' theme

Using Wordpress 3.8.1 with 'Twenty Fourteen' theme I'd like to arrange my post in such a way that it's main contents go to main (center) column while galleries, attached files and links pertaining to ...
0
votes
1answer
80 views

How to display only some widgets of a sidebar?

I would like to break up a sidebar over three containers. Each container should hold up to three widgets of the sidebar. Therefore, I need to find the HTML for only the widgets 0 to 2, 3 to 5 and 6 to ...
0
votes
1answer
78 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
2answers
49 views

Add Shortcode tag in Widget/Sidebar

I want to add a shortcode tag in the sidebar/widget. I am able to get the required functionality if I add the code in the theme's function.php add_filter('widget_text', 'do_shortcode'); My problem ...
0
votes
0answers
60 views

Widget on home page displays wrong time compared to same widget on inside pages

I am trying to use the timely events calendar and I have the upcoming events widget on my home page widget area. The time that displays is not the time I have selected. When I put the same widget to a ...
0
votes
0answers
12 views

Diplaying widgets causes responsive slider to not show up

I'm making a custom home page template. On the top I have an image slider(using the Responsive slider plugin). Than I query some posts and after that I want to include one of my widgets. The problem ...
0
votes
0answers
280 views

Displaying database table in backend of wordpress

So basically I'm working on a job website for a client where they post jobs and users can apply for these jobs with a form that writes to the database with their inputed information.. I have set up a ...
0
votes
0answers
21 views

How do I add a field only to certain default WordPress widgets

I've made a plugin that adds a language select field to all admin widget forms based on the following three pages and and a bit of extra googleing to solve some specific issues: ...
1
vote
1answer
53 views

How to modify the default Wordpress 'Pages' widget to have titles on the anchor tags?

So basically, the 'Pages' widget just prints out a list of all pages names as links (as you all probably know). Although, these anchor tags do not have any titles, and that is frowned upon in the SEO ...
0
votes
0answers
57 views

iframe not being displayed in a widget

I'm trying to write my first widget so i'm not that expert with the code. I have the following code in my function.php but the iframe is not being displayed: class account_internet extends WP_Widget ...
0
votes
1answer
46 views

Add links widget to self-hosted blog?

http://en.support.wordpress.com/widgets/links-widget/ discusses a Links widget that makes it easy to create a blogroll in your sidebar. I'm not seeing this widget in my blog by default, and searching ...
0
votes
2answers
129 views

How can I add a new CSS class to a widget?

I want to assign a new CSS class to default widget <ul> in Page/Post creating page in WordPress. How can I do this? See the image below.
0
votes
1answer
214 views

How to display custom message for (Genesis) featured posts if no posts

I'm using the Genesis Framework, and the custom post types featured post widget (code below). I need to display a custom error message for a particular post type if there are no post present for that ...
0
votes
1answer
396 views

How to add Custom Fields to Settings in Widget Options for all Registered Widgets?

I want to add input box in the custom form when we click for Widget Settings. Really like to have this additional text box in all widgets be Custom Made or the default ones. I'll be needing help in ...
0
votes
1answer
73 views

Why would apply_filters return a non-empty string, when the value returned is empty?

Been breaking my keyboard over this. Did a proper install, uploaded the database to a fresh MySQL and been working on using child themes properly. But there is something plaguing me I can not figure ...
-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 ...
0
votes
0answers
44 views

Disable default Wordpress widgets in sidebar

Im creating my own theme. When I have a clean wordpress installation, there are some default widgets in the sidebar (search, category, recent posts etc). I know that I can remove them from the sidebar ...
1
vote
1answer
121 views

Displaying a variable stored in functions.php inside widget

I'm trying to display a variable that is stored inside my functions.php file - for the sake of the question this variable is stored as $test = 'test';. When i use echo $test inside page.php, ...
0
votes
1answer
276 views

Widgets not showing in my custom theme

I am developing this WordPress custom theme: http://onofri.org/WP_BootStrap and I am trying to insert a widget area under the Partner e Sostenitori section, but can't work. I have performed the ...
0
votes
1answer
30 views

How can I specify that an area of my theme contains widgets?

I am pretty new in WordPress theme development and I am developing a theme that use BootStra CSS framework I have to do that a specific area of my theme can contains some widget\module (I don't know ...
0
votes
1answer
60 views

jquery conflict with widget page

I'm trying to create a widget plugin that uses a jQuery code to show/hide divs in the widget form based on the selected option of a select drop menu. The jQuery code I'm trying to implement is ...
-1
votes
1answer
60 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
190 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
87 views

Duplicate sidebar with duplicate post plugin

I'm using http://wordpress.org/plugins/duplicate-post/ and http://wordpress.org/plugins/per-page-widgets/ . The duplicate-post plugin doesn't copy all the settings from the page-widgets plugin. I try ...
0
votes
1answer
24 views

Plugin: Unable to Save the Image Alignment Option to Display in the Widget in the Sidebar

I am trying to add a select option to help user align the gravatar image. The problem is all value are saved except for the Image Alignment. When they select Image Alignment, it will revert back to ...
0
votes
1answer
18 views

Widget only in first post

I want to put a widget area into the content of the first post. My problem though is that is can't figure out how to get only the first post in my function. Here is my function: function ...
0
votes
1answer
44 views

Transform php shortcode into a widget [duplicate]

I have this bit of php that calls a short code with the date of today in the format i need. <?php $today = date('d.m'); echo do_shortcode('[table id=1 column_widths="10%|10%|80%" ...
1
vote
1answer
67 views

Add more widget areas to a theme

what's the best approach to add more widget areas to a theme? currently, my theme has 2 columns that display the widgets, but I'd like to extend it to 4 for example. It currently looks like this: ...
0
votes
0answers
34 views

Change the order of sidebars in admin

Say I use a child theme and my parent theme already registered four dynamic sidebars. Now I am registering a fifth dynamic sidebar in the functions.php of my child theme. In the backend that last ...