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

learn more… | top users | synonyms (1)

1
vote
1answer
74 views

Hide all Dashboard Widgets (not remove)

Is there a to hide all dashboard widgets, not remove them? I want my widget to be the first widget but according to the docs there's no way to specify where your widget shows up since it's all "core", ...
0
votes
1answer
44 views

Wordpress widget title coding

I have a problem with wordpress widget titles, some widgets are not affected by theme custom encoding. Here is the codes; function ecce_widget_title($title){ if( empty( $title ) ) return ' '; else ...
0
votes
0answers
29 views

How can I add widgets to specific post

Some of my post are longer than others. On those post I want to display more widgets for social media and such to fill in space, as well as to gain more exposure. I know there are plugins but I ...
4
votes
2answers
297 views

Can I display the widget admin in the page admin?

I would like to show the 'Appearance -> Widgets' menu underneath the text field in 'Pages -> new/edit'. Is it possible to take one part of the admin and show it elsewhere? Reading some of the ...
0
votes
0answers
61 views

Special characters showing in fallback font

I have created a widget that displays some text using a custom font imported with CSS @font-face. The font have support for scandinavian characters åäö, but when I display these characters in my ...
0
votes
3answers
193 views

Pass widget variable to external function

I am working on a custom widget which displays posts from a selected taxonomy (category or tag). This widget contains a textbox which the user enters an ID of a taxonomy (category or tag) to exclude ...
1
vote
2answers
941 views

Can I remove a widget area without editing code?

I am dealing with a Wordpress setup which has 2 widget areas. One seems to be breaking the page, and I want to remove it. Here is the screenshot of my widget setup How can I remove the Main ...
1
vote
0answers
33 views

Widget on the right side of the page overlaps with the left side

I added the mailchimp widget to the right column of my blog. But for some reason, it overlaps with the main content of the blog. Here is a screenshot of what happens Would anyone know why this ...
0
votes
0answers
24 views

What's the policy for building a theme that doesn't support widgets/menus?

I'm developing a minimalistic theme, and my plan is not to include menus or widgets in it. The Theme Review page on wordpress.org states: Whether implementing required, recommended, or optional ...
1
vote
1answer
134 views

Extending WP_Widget throws error when Monster Widget used

I wanted to override the output for the core Recent Comments Widget. I extended WP_Widget_Recent_Comments made the changes needed and it displays exactly how I want. However, I have now tested the ...
5
votes
3answers
143 views

Prevent second widget activation

Is there a way to "remove the widget from available widgets" after you've activated it once on some area? The idea is to allow user to activate only one instance of it.
0
votes
1answer
29 views

Apply code for all else first block

I have this code for sidebar in Wordpress :- register_sidebar(array( 'name' => 'Main sidebar', 'description' => 'main sidebar.', 'before_widget' => '<div id="blocks" class="siderbar ...
0
votes
1answer
126 views

Widget checkbox array empty on update function

I have a widget that is not passing checkbox state to $new_instance, specifically $instance[ 'posts' ]; if I dump $new_instance in the update function it is empty? All the other instance variables are ...
1
vote
1answer
182 views

Widget options get

How to get widget options? I've tried like this, like seen in the other question "Using widget options outside of the widget": $w=get_option('widget_wp_mywidget'); $one=$w[2]["myval"]; ...
0
votes
1answer
51 views

Insert to wp_footer if widget is found in the sidebar

I trying to insert a code into wp_footer whether the widget is present or not in the sidebar. How to avoid the unnecessary code in the footer? Add the code only if widget is present the sidebar. ...
0
votes
2answers
61 views

is_active-sidebar loop

So I have 4 widgets which is in large-3 columns, when they're not active I place a placeholder as user guide so the user would know where to put what. I did manage to work out the is_active but it ...
2
votes
1answer
60 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 ...
0
votes
1answer
60 views

Random sidebar/widget background

Does anyone have a clever idea to get a random/changing background for just the widget sidebar?
0
votes
1answer
87 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
46 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
281 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
130 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
114 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
302 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
53 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
45 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
471 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
34 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
37 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
73 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
237 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
31 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
31 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
124 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
721 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
81 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
81 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
51 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
64 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
14 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
291 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
56 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
67 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
47 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 ...