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

learn more… | top users | synonyms (1)

0
votes
2answers
552 views

How can i initialize a widgetized sidebar (with widgets)

I have a WordPress multisite installation. The client wants an email update form on the sidebar of every blog. I want to use a widget there so I need to assign it to the sidebar. Is there any way to ...
0
votes
1answer
370 views

Sidebar login widget with error print, returns an error

i'm building a widget to login from the sidebar and print errors if any, so everything is working fine except that when i login it returns an error: Warning: Cannot modify header information - headers ...
0
votes
1answer
1k views

How do you force a sidebar widget to have a container div around all child widgets?

My theme creates several widget areas for the end user. However, I've got a slight problem in that, if multiple widgets are dropped onto any sidebar container, the resulting code in "view source" is ...
0
votes
1answer
439 views

Placing a widget with $wpdb query

I'm getting the feeling that adding Widgets via MySQL query is not as simple as I thought. I was under the impression all data is stored in the options table, but it seems like I was wrong. Any idea ...
0
votes
1answer
195 views

Missing sidebar parameter “fix” - before_content

as you know the sidebar parameters from register_sidebar() that control the widget layout are - before_widget - after_widget - before_title - after_title the problem is that you cannot implement ...
0
votes
1answer
13 views

modifying title (in dashboard) for different widget instances

When I insert multiple instances of widget in a particular sidebar, they all appear by default collapsed and with the same title. E.g.: In this case, the user can upload a different pic to each ...
0
votes
1answer
21 views

How do I make the title of the following widget editable?

I have the following widget which displays basic info for a game: class Game_Info_Widget extends WP_Widget { /** * Register widget with WordPress. */ public function __construct() ...
0
votes
1answer
27 views

How to translate Widget Description in constructor?

I'm building a localized widget and the translation works everywhere but in the language string in the constructor. I have read that the whole plugin initialisation has to be bound to the init ...
0
votes
1answer
47 views

Modifying the default search widget

I'm creating a plugin widget that does a different search from the normal default search widget. I copied the code from the default widget: class new_search extends WP_Widget { ...
0
votes
1answer
37 views

Do I have to widgetize my pages?

I have a three pages. On front page I want to show some custom test about page1,link to page1, custom text about page2, link to page2, custom text about page3, link to page3. And then I want a ...
0
votes
1answer
53 views

Static image for embedded YouTube video instead of blank player?

Thanks to this answer I have embedded a YouTube video in a Text Widget using [video src="http://youtu.be/JQ_2De2cnzI&rel=0&showinfo=0"] However it displays as this blank player when the ...
0
votes
1answer
53 views

display specific widget to a page

im trying to display a specific widget i need for the header current im using a code to display all widgets but my problem is that if I add additional widgets it will destroy my site. ...
0
votes
1answer
47 views

How can I retrieve data within my widget

I have a Widget which I am creating but my quesiton is how do I access my custom table which I created via my plugin. I am attempting to fill the dropdown from the table called tfp which contains the ...
0
votes
1answer
105 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 ...
0
votes
1answer
49 views

Why isn't my custom widget outputting any content?

I've been following numerous tutorials and codex pages in order to make my own widget in WP 4.0. It seems as though I'm very near; I can output something from the widget, just not any of the fields. ...
0
votes
1answer
62 views

Escape HTML on WP input

I am slightly stuck on creating a widget, it has an input (bit like the default text widget) but got an issue adding html into it. My code is: $instance['content'] = ( ! empty( ...
0
votes
2answers
73 views

Twenty Twelve Widget Taking Space

I am using the twenty twelve theme and in this theme I used the Main Sidebar for widgets. I used the code below to make the widgets disappear in my homepage ( front page ). The code works however, the ...
0
votes
1answer
26 views

Can I get variable into dynamic sidebar?

How can I get a variable into a sidebar? $sidebarnum = 4; dynamic_sidebar('Footer Widget $sidebarnum'); ?>`
0
votes
1answer
51 views

latest posts-widget displays all posts on archive page but works great anywhere else

I noticed the latest posts widget in my footer displaying all posts. Anywhere else on my page, it displays only the amount of posts it should. I am using a custom theme and this is my archive.php: ...
0
votes
1answer
33 views

Why is the phone number a hyperlink on desktop sites, in my widget?

Here is the widget function from a widget I created. For the phone number, I don't understand why it is making it into a hyperlink on desktop sites, using the value of the if before ($gplus) for the ...
0
votes
1answer
27 views

Customise the Category Widget

Similar to my Search Widget question Is there a way to customise the Categories Widget? Again trying to add in extra markup. Thanks
0
votes
1answer
20 views

Is there a way to dump all registered sidebar/widget?

I need to know the properties of sidebar and widgets I've added, is there a way to dump those? Thanks.
0
votes
1answer
36 views

New Widget are not showing

I added a new sidebar according to WordPress Codex and for some reason it shows only on the admin and nothing shows on my front pages.. I tried to look for it on Google and here on the forums but I ...
0
votes
1answer
219 views

Theme's default styles are overriding my plugin's custom CSS

I have created a little plugin that creates a widget that I've made, basically just a pretty <ul> element. Unfortunately, all default widget styles are overriding my custom CSS, and adding ...
0
votes
1answer
30 views

Instance not inserting data for widget

I am trying to create a widget for my website. This is my first instance of widget creation and I am really unsure as to what the issue is Here is my code as it stands: add_action( 'widgets_init', ...
0
votes
3answers
119 views

Allow different <span> tags in widget titles

How can I make widget titles allow HTML? I want to add icons from an iconfont to the titles like <span class="icon-someicon">Widget Title Here</span> I tried the following but it does ...
0
votes
1answer
76 views

Wordpress widget in custom theme

I created a custom theme and writing a basic widget for my wordpress based website. If I paste the code in functions.php the code works fine, however if I paste the code in a separate file and keep it ...
0
votes
1answer
50 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
1answer
146 views

Removing side bar widgets from GovPress theme

I'm using the GovPress theme, I've created a child theme. I now want to remove the sidebar widgets, as they are no use to me. I've read multiple articles online, but none of them work. I believe I ...
0
votes
1answer
92 views

the_widget() inside functions.php

I'm setting some options in the backend using functions.php and I'm doing: $w = the_widget('My_Custom_Widget'); but I don't get any output. However doing <?php the_widget('My_Custom_Widget'); ...
0
votes
1answer
46 views

Widgets not showing on sidebars

I have registered two sidebars in my theme using the function below, but none of the widgets shows up in the sidebars even though I can manage them in the dashboard: // register sidebars add_action( ...
0
votes
1answer
87 views

wp_dropdown_pages in widget form

I have a small quirk somewhere in my widget form. Upon saving the widget instance, the form refreshes with the wrong selected 'page_id' from the wp_dropdown_pages input. If I refresh the widgets page, ...
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
466 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
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 ...
0
votes
1answer
76 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 ...
0
votes
1answer
303 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
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
2answers
58 views

Using filter in the widget causes fatal error

I'm adding a filter for a WordPress query in a widget. I'm adding as following: function filter_where( $where = '' ) { } add_filter( 'posts_where', 'filter_where' ); $query = new WP_Query( $args ); ...
0
votes
1answer
208 views

Dashboard Widgets - Add Admin Page With Same Functionality

I have a plugin that has its own dashboard with basically quick-views of relevant data and I wanted to know if there was an "easy" way to mimic the functionality of the admin dashboard where you can ...
0
votes
1answer
97 views

What conditional to use for dynamic sidebar check?

I have looked here on WA and also on the codex but there is no definitive source that I could find. Which is the proper/best way to check to see if a dynamic_sidebar is active and contains a widget? ...
0
votes
1answer
68 views

Customizing the Widget content markup

I am using bootstrap to create panels for the sidebar widgets, and I can set the container markup for the widget, as well as the markup for the panel header, but I cannot provide the markup for the ...
0
votes
1answer
133 views

Best way to add internal link in widget

I'm looking for a way to transform a static piece of code into a widget to display in different sidebars containing a simple internal link. The basic code is: <div class="my-link-box"> <a ...
0
votes
1answer
49 views

Widget : html 2 dimensional array doesn't work

I have some strange trouble with my WordPress today : I want to store same multiple values in a widget, so I create something like this : myCollection[id][myField] as input's name for my admin widget ...
0
votes
1answer
860 views

Display custom widget value in header.php

I am using the code below for a custom widget. I have added some fields in the widget like: Title, Name and a checkbox. Now everything is fine but I want to show those values in header.php. Any idea ...
0
votes
1answer
49 views

call widget from within shortcode

I have a shortcode in my functions.php which runs a query on a category. I want to have a twitter feed on this particular page. I have a javscript option working on my page for twitter right now but ...
0
votes
1answer
1k views

How to add Wrapper Div/container element around Wordpress Widget Content

I want to apply style to widget content of Wordpress but I see widget Content area is not having uniform class. TextWidget are having class "textwidget" and that is uniform but other widgets are ...
0
votes
1answer
204 views

display most popular tags in two columns

I have a section in my sidebar where I'd like to display my most popular tags in two columns. I found this post from WPSnipp that details how to narrow your list down to only the most popular, however ...
0
votes
1answer
146 views

Add custom data (field) to sidebar widgets for later display

I am building a theme that allows widgets to be dragged & dropped, essentially turning WP into a desktop-like environment where the admin controls what "apps" are available via the widget panel. ...