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

learn more… | top users | synonyms (2)

0
votes
1answer
464 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
203 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
19 views

How to append custom text to the output of 'categories widget'?

How do I customize the "categories widget" to append additional text on the sidebar display? from category 1 category 2 category 3 category 4 to category 1 folder category 2 folder category 3 ...
0
votes
1answer
17 views

wrapper div for widgets not showing with all widgets

I have registered a Widget area with the following code: // Register Sidebars function custom_sidebars() { $args = array( 'id' => 'footer_sidebar', 'class' ...
0
votes
1answer
28 views

Enabled checkbox by default in WordPress widgets

The code works as expected. The issue happens if I set 'show_post_count' => 1 by default. In this case checkbox will be enabled always. How should I update the code to work as expected even if ...
0
votes
1answer
21 views

Is there a way to use get_sidebar() when no widgets are activated?

WP version 4.4.2, I have a customized sidebar.php and no widgets activated, which automatically prohibits get_sidebar() function to load contents of sidebar.php. Is there a way to forcefully load ...
0
votes
1answer
90 views

How to get post category list as select in front-end?

I use widget plugin Getting the random post & URL via ajax. I want to add function, that allows users on frontend choose category, and than display random posts from this category. function ...
0
votes
1answer
46 views

Simple php in wordpress widget [closed]

I am trying to calculate with simple maths but I cant get the following form make the calculations and output the results. Unfortunately I am a newbie. What's wrong? <?php add_action( ...
0
votes
1answer
42 views

How do I insert an amazon search widget into posts or pages?

How do I insert an Amazon Search Widget into posts or pages? The source code is: <SCRIPT charset="utf-8" type="text/javascript" ...
0
votes
1answer
80 views

wp_get_attachment_image() not displaying post images even though wp_get_attachment_url() echo correct urls

I am trying to make a widget which takes post id as input from user and displays images of the specified post in sidebar. wp_get_attachment_url() gets me the url but in the next line ...
0
votes
1answer
102 views

How to display widgets inside a page content without a plugin?

I want to build a homepage where I can show posts gathered from different categories and having the ability to choose such categories from the admin. I was thinking to use widgets for this. Is the ...
0
votes
1answer
44 views

A/B test options at the widget level [closed]

I am looking for a method to show 1 of 3 different widgets on my site's homepage. I could do this with javascript, but this would increase page weight and I would rather do it at time of render ...
0
votes
1answer
26 views

Shortcode not working in widget

I created the following shortcode: function newsletter_signup_shortcode( $atts ) { $post_type = get_post_type(); // Attributes extract( shortcode_atts( array( 'location' => ...
0
votes
1answer
43 views

How not to display an instance of a widget dynamically?

How to change the CSS style for an instance of a multi instance widget dynamically depending on the result of an SQL query? When the query returns nothing at all, I would like that the instance of the ...
0
votes
1answer
15 views

I've set up an extra field for all the available widgets. How do I show it's value in the front-end?

Thanks to another great post here I managed to set up an extra field (called "subtitle") for all WP Widgets. Now I am trying to make all WP widgets display the value of this extra field (naturally, ...
0
votes
1answer
160 views

Is it possible to remove <ul><li> from default category widget?

I´m having some difficulty override to default category widgets in my wordpress theme. I created the theme from scratch. I want to remove the <ul><li></li></ul> from ...
0
votes
1answer
60 views

Is there any tab widget plugin supporting third party widgets? [closed]

I am searching such a tab widget supporting third party widgets, such as YARPP, TOC+, Ultimate Tag Cloud. The following two popular tab widgets doesn't meet my requirements. WP Tab Widget: only ...
0
votes
1answer
26 views

Load widget only on blog posts

I am attempting to ensure a widget is only loaded on blog post pages. I tried using $post_type = get_post_type( $post_id ); inside the widget function of my widget class. However, upon loading pages ...
0
votes
1answer
29 views

Add footer widgets

My website is running on WordPress theme which does not have options to add footer widgets. How can I add it using other ways?
0
votes
1answer
16 views

Widget page stopped loading

I'm currently having an issue with the widgets page in the backend. however I'm having a heck of a time identifying what's break the page. I've found there are 3 widgets that when removed from the ...
0
votes
1answer
112 views

Where are widget configurations stored?

I did search and saw a similar Where (what directory) are the default Wordpress Widget Codes stored? but this is not my question. When I have a lot of widgets configured, say a few dozen RSS feeds ...
0
votes
1answer
61 views

How to use title attributes in sidebar widget?

I have a custom post type "article" & I need to display some custom urls is a widget in the sidebar using php code widget. When I use this code withing the loop it works perfectly: <a ...
0
votes
1answer
17 views

Add drop down to widget if it is in a certain area

Is there a way to programmatically add a dropdown selector to any widget added to a given widget area? I have a header widget area and I'd like any widget added to it to have a dropdown box with the ...
0
votes
1answer
433 views

Widgets in WP 4.3 disappearing - How to fix?

I definded my widgets as seen in the following code. Since update 4.3 Wordpress did some changes i can not fix. Any ideas what i need to change in order to see the widget in the frontend again? I can ...
0
votes
1answer
35 views

Why can't I see “Widgets” in my Apperance menu?

So I am trying to create a widget-area. And after adding some code to the functions.php I noticed that I can not see "Widgets" in my menu. So I figured I had to add "widget support" to my theme so I ...
0
votes
1answer
101 views

Wordpress Widget Not Saving Instance

I have very simple wordpress widget, that has 3 input field. Whenever i submit data, it does not save to database. I have added and deleted the plugin , deactivated and reactivated multiple times, but ...
0
votes
1answer
505 views

Making jQuery .change() event persistent after widget save

I'm creating a custom widget that uses a select element with a bunch of options and a simple jQuery function to trigger the visibility for some <div>s below it based on the selection, through a ...
0
votes
1answer
155 views

passing variables inside a widget add_action

Here's my code inside a widget class: function widget($args, $instance) { add_action('wp_footer', function () { echo $instance['title'] }); } It doesn't output $instance['title']. I tried passing ...
0
votes
2answers
40 views

Output column number according to active sidebars

$sidebars = array( is_active_sidebar( 'footer-4' ), is_active_sidebar( 'footer-3' ), is_active_sidebar( 'footer-2' ), is_active_sidebar( 'footer-1' ...
0
votes
2answers
204 views

Warning: Missing argument 2 for widget_title filter

Based on this question, I'm getting an error Warning: Missing argument 2 for.... This happens for some widgets those are created by plugins. -- Edit 1 -- Here's a simple widget that causes the ...
0
votes
1answer
79 views

How to save widget settings on field value change?

I'm developing a widget. Its form has two HTML select elements: one to display a list of all categories, and the other for displaying a list of posts based on the selected category. The posts HTML ...
0
votes
1answer
510 views

How to get options of all active widgets ?

I am currently using a loop that goes trough all sidebars looking for widgets than loop those again in order to get all widgets options. Doing this on add_filter('sidebars_widgets', array($this, ...
0
votes
1answer
17 views

How to allow editing of text in sidebar?

I am developing a theme which has an area of the sidebar which displays the blog owner's bio and photo as a background image. I could hard-code this information, however, I'd like to learn how to make ...
0
votes
1answer
2k views

Showing a Thickbox (tb_show) does nothing

I'm trying to add a media uploader to a widget/plugin and I'm at the stage where I need to add a picture from the media library (or upload a new one). I added some javascript and added an event to a ...
0
votes
1answer
82 views

Can't save widget

I can't save widget. When I click save, I can see wait circle, and nothing happend. When I visit again widgets section, it's empty. Then I changed view to Accessibility Mode, and still no luck. Then ...
0
votes
1answer
136 views

How to activate or install the Gallery Widget?

I would like to activate the Gallery Widget which is presented here. It seems that it's part of the general Wordpress distribution but the widget is not listed under Appearance → Widgets. BTW, I don't ...
0
votes
1answer
28 views

How should I add a “widget” like element?

I would like to add a custom slideshow like "template" which can be called in to other template files. My first thought was to create exactly that; a separate slideshow.php template file which ...
0
votes
1answer
252 views

How to add a text widget on the posts admin page?

I need to add a text widget on the posts admin page ie, the post editor page. so that I can add some code in the text widget for some purposes. Right now I have used text widget and this can only be ...
0
votes
1answer
63 views

Shortcode into widget

I have this particular shortcode "[example]" I know I can put this in a text widget to make it work. But I was wondering about how I can turn this into a widget called "Example." Any suggestion? ...
0
votes
1answer
105 views

Can I have a widget and sidebars in custom theme?

Wordpress 4.1.1: simular problem to another question: I have a add_action widgets_init call back in which I have a call to register_widget that registers a class and a call to register_sidebar that ...
0
votes
1answer
62 views

All Posts Have The Same Comments

I'm getting a really weird bug. I'm getting the same comments from 1 specific post which is the "Hello world" for every single post! But when I remove a bit of code for a recent posts widget that I'm ...
0
votes
2answers
652 views

Widgets won't save

I have almost no experience in creating widget area's and I am stuck at saving the widgets in the widget area 'red menu'. I have searched a dozen posts but I can't seem to get it working. I am ...
0
votes
1answer
481 views

Custom widget doesn't save values from dropdown box

I am trying to save the value from a dropdown box on a custom widget created by me. the title from the same widget is getting saved, but not the values from drop down box. Can someone please help me? ...
0
votes
1answer
81 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
50 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
112 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
2k 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
41 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
974 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
70 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. ...