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

learn more… | top users | synonyms (1)

0
votes
0answers
16 views

Working widget does not show up in appearance->widgets

I try to add a custom widget for use outside of a normal sidebar. For that I have created class myfirst which extends WP_Widget and with appropriate function overrides. namespace widget; class ...
0
votes
1answer
17 views

Widget to add an different image to sidebar (by category)

I want to add custom content (maybe using a widget) on my website's sidebar that changes by category. For example, if a user lands on the 'Cars' category, I want to show an image related to cars. In ...
-1
votes
0answers
8 views

Adding content to sidebars? [on hold]

I have deleted the sidebar from my posts page and only left it on the main page, however I want to use that space in my posts to either stretch the content or add something else. Here is the link to ...
0
votes
0answers
17 views

How can I embed a .php file inside of a widget?

I have a currency exchange that I'm trying to put in the sidebar of my Wordpress site. The currency exchange is a simple php file that I'm trying to 'embed' as a widget. I created a simple plugin, ...
0
votes
1answer
14 views

Default Wordpress widgets always appear

I added only 3 Widgets to my sidebar, however when I set their visibility to hidden in post pages they disappear but ALL the default widgets appear. I want to remove the default widgets from appearing ...
0
votes
0answers
20 views

Shortcode in HTML not working [on hold]

I'm having a lot of trouble with something that seems simple. I'm trying to get a form to appear inside a lightbox (using the Easy Fancybox plugin – feel free to recommend an alternative since it ...
0
votes
1answer
19 views

Remove default WordPress widgets

Hey guys here is the problem I have added 2 sidebars to my blog, however when I change their visibility to only appear on front page and when I click on a specific post ALL of the default widgets ...
1
vote
2answers
28 views

Cannot save widgets in custom sidebars

I'm working on a child theme of the Toolset Bootstrap Theme. I need to create a custom sidebar, so I registered the new sidebar in my child theme's function.php file: function ...
23
votes
3answers
6k views

Programmatically add widgets to sidebars

I would like to programmatically add widgets to my two sidebars that I've got. I couldn't find any official way of doing it? I started looking in the database. I've found that it's the ...
0
votes
0answers
12 views

Widget options are not updated

I'm creating a plugin which creates a widget with some options. I've extended the WP_Widget class: class Dynamic_Player_Widget extends WP_Widget { function Dynamic_Player_Widget() { ...
0
votes
0answers
7 views

Enqueue script in Widget

I am trying to use wp_enqueue_script inside function widget of the Widget class. But it seems like when I print html it doesn't handle the javascript functions which I enqueue before. This enqueue ...
0
votes
0answers
12 views

Widget form method does not work properly

I need your help. I have this code <?php class Messenger extends WP_Widget { function __construct() { $widget_ops = array('name' => 'Messenger', 'description' ...
1
vote
2answers
260 views

Add description to custom text widget and display the 5 recent post titles

I just started coding and working as an intern for a company. My boss asked me to create a custom text widget for practice in making word press widgets. The problem I am running into is I have no idea ...
1
vote
1answer
33 views

How do you create dynamic customised sections in Wordpress?

I am very new to Wordpress and I just like to ask a fundamental question about its structure. I understand that Wordpress uses different files as templates for different sections or types of pages. ...
0
votes
0answers
13 views

How to change the title (name) color of new custom widgets in backend

I created a few custom widgets. The following part of the code set up the title (name) and description. How can i include a class for the widget title (name) to change the color of the name that ...
3
votes
3answers
302 views

How do I save data from submitted form from widget

I'm looking over internet for some simple solution of email subscription widget but no luck. Or they are too complicated and paid, or they are relaying on some external email functions. I'm not a ...
0
votes
1answer
32 views

Check which registered sidebar a widget is added to

I have 2 registered sidebars in my theme one for Products and one for Blog. What I am trying to do is if my "Category" widget is added to the Product Sidebar the taxonomy is automatically set to ...
0
votes
1answer
23 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 ...
-1
votes
1answer
12 views

How to make custom dashboard widget to display alert in front-end?

I need to make a widget to display any alert in front end The widget is in dashboard section on backend and any user can use yet. The content of the widget in dashboard is: Welcome message On/off ...
-1
votes
0answers
13 views

daily , weekly , monthly popular posts widget [closed]

I looking for plugin popular posts widget having daily,weekly,monthly options. and styles like Posts Slideshow Widget. or add function in this plugin. ...
0
votes
0answers
10 views

How can I hide the dashboard widgets using install.php

I have created my own install.php file in the wp-content folder and I am using it as a drop in to customise my install of Wordpress. Currently I am using the following to hide (NOT) remove the ...
0
votes
2answers
379 views

Unable to load “wpColorPicker” on theme customize page

Whether I'm using a Wordpress default theme or a custom one, I see the JS error: Uncaught TypeError: Object [object Object] has no method 'wpColorPicker' when I click "Customize" on the theme. I've ...
0
votes
2answers
47 views

How to determine if the sidebar is empty? Or not active?

I used is_sidebar_active('NameOfSidebar'), but it seems not working. It returns false all the time. I wanna have a condition that goes like this if('sidebar is not active'){ //must not display the ...
0
votes
0answers
18 views

Show sidebar from custom meta value

I want to show sidebar from meta value.Basically I am using wp-page-widget.Now I want to show the active widget.Since I am working on one page template so general procedure will not work. Upon ...
1
vote
1answer
325 views

Adding WordPress colorpicker in widget settings

I want to add the WordPress default colorpicker in widget settings form. Here's what I'm trying: In my functions.php, I have this: function widgets_scripts( $hook ) { if ( 'widgets.php' != $hook ...
-1
votes
0answers
26 views

Adding datepicker field to my custom widget

I want to add a Datepicker field to my custom widget. So that I can select a date from backend. I have tried a lot but no proper solution. class ownplugins extends WP_widget { public function ...
9
votes
3answers
2k views

Update widget form after drag-and-drop (WP save bug)

I've posted a bug-report about this a few months ago (on WordPress trac (Widget Instance Form Update Bug)) and I thought I'd try writing about it here too. Maybe someone has a better solution to this ...
0
votes
1answer
763 views

How to have Multiple Archives Widgets, one archive widget per category (in a different page)?

Please read the whole question before assuming this question is repeated. After one day of trying plugins and tutorials, I am convinced that there is no straightforward method of achieving what I am ...
0
votes
1answer
42 views

Paginate recent posts widget

I've created a clone of the core Recent Posts widget as suggested here Code for Recent Posts Widget, but how would I go about adding pagination to that widget? I intend on using auto-pagination for ...
0
votes
1answer
18 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
1
vote
1answer
18 views

Insert Widget option into mark-up with register_sidebar

I have added a custom field to my all widgets in my theme, called "custom-title". I have managed to save the field into the database for each widget, like so: s:12:"custom-title";s:17:"HELLO TEST ...
0
votes
1answer
16 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
30 views

Customise search form in the Widget

I would like to customise the Search Form that you drag and drop from the widgets panel. The customisation will be more than just css changes. I would like to add and custom classes. Is this ...
0
votes
0answers
2 views

Accordion script fails after widget save process in admin [migrated]

I used the ddaccordion 2.0 script by Dynamic Drive to create an accordion function for a widget in admin area and some vexing issues are occurring as I cannot determine a solution. On initial ...
1
vote
2answers
63 views

Display attachment, post and page in recent comments widget

The following code (old post is here and author is diggy) is useful, but i'd like display post and page on recent comments widget, not only attachments. function wpse80087_widget_comments_args( $args ...
0
votes
0answers
11 views

why ’ quote double quote in database wordpress

i'm trying backup and restore database using php code. but i don't know why quote double quote show in database wordpress, something like ’, and destroy my wiget_text. So how can i fix that.? help ...
0
votes
0answers
43 views

Widget Select Options not saving

I have a widget where there is a select dropdown, with a list of all the pages on the site. I am trying to get my code correct so that when a user chooses a page, after clicking Save in the widget, ...
0
votes
1answer
17 views

How to show a widget for logged-in users only?

have a widget that I want to hide from visitors to the site. I know I need to use this code; if ( is_user_logged_in() ) { echo ''; } else { echo ''; } How do I use this in a widget? What ...
0
votes
1answer
22 views

Add space to the end on a widget

I have a widget that when stacked with another the out put from my widget to the next sit on top of each other. I tried echo <br> but that gives me a fatal error. Is there any other code to add ...
-2
votes
0answers
16 views

Add link with title to a widget

I Have a widget that I need to add a link for the users. I want a title for the link to show ( Friend ) and be able to attach a link to it. The rest of the widget works except i cant figure out how to ...
0
votes
1answer
258 views

Multiple entries in get_option results? or why is _multiwidget set to 1?

I am developing a wordpress widget, and need to store some user configuration values, that is why I am using wordpress update_option and get_option. I am new to widget development. I have some ...
0
votes
1answer
33 views

Add sidebar in inner pages

I am new to wordpress coding. I want to add a sidebar to pages other than the home page, both pages are my custom templates. I want to list in admin so that admin can edit the content of sidebar. ...
0
votes
1answer
36 views

Shortcode in Text Widget not working

Not sure why this is not working. I get no errors, but just shows nothing at all in the text widget. The shortcode works on pages and posts. WordPress version 3.9.1 add_filter('widget_text', ...
0
votes
1answer
20 views

Can't output the number 0 in widget

I have an input box where a user can input a number and then that number will be outputted into an html page. It all works fine except when you enter in the number 0 it doesn't output anything but it ...
1
vote
1answer
32 views

I wrote my plugin. How to display the result of the plugin's function to sidebar (widget?)?

I wrote my plugin. How to display the result of the plugin's function to sidebar (widget?)? <? function register_form () { global $post; $test = "testesttest"; var_dump("testtest"); ...
0
votes
2answers
23 views

Wordpress - registering sidebar and adding a button directly after .textwidget

I have registered a new widget area, code as below and want to add a button after the .textwidget, however cannot seem to do it properly. Adding it after the </li> results in the button not ...
1
vote
1answer
31 views

How to check if a widget has no title

I wanted so that my widget has the following structure: <div class="widget-area"> <h4 class="widget-title">Foo Bar</h4> <div class="widget-content">Blablablabla ...
0
votes
0answers
29 views

How to give dynamic url path in widget?

I have a widget and give link to some text within it like href="http://www.netattingo.com/dev/imc/" as it is static path in widget but when I try to to use "site_url" or "bloginfo". It does not work. ...
2
votes
6answers
6k views

Including Custom Post Types in “Recent Posts” Widget

I'm able to easily include my custom post types into my main loop by making small adjustments with query_posts(), but I'm not sure how I would go about including custom post types in the "Recent ...
0
votes
0answers
24 views

Widget Areas Still Appearing in WP ADMIN When They Shouldn't

I had a bunch of "Widget Areas" registered for my theme. I removed a few and added a few. The ones which I removed, I deleted the code which is hooked on widgets_init for registering the sidebars. I ...