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

learn more… | top users | synonyms (2)

0
votes
1answer
2k views

Sticky menu for WP custom menubars

This seems simple, except that I am not able to figure it out. In a wordpress theme, how can I make a custom menubar below the header image stick at the top after scrolling down the page? Example ...
2
votes
4answers
228 views

WP_Widget deprecated error in Wordpress V4.3

This error only happened this morning as I updated my wordpress site to version 4.3. Two other sites on the same hosting ( and all using CPanel as an admin portal for the hosting) are not having any ...
4
votes
1answer
49 views

can require “themefolder/includes/widgets.php” in “themefolder/functions.php” yet widgets.php doesn't run

In order to keep things clean I use functions.php almost solely to require other files. As such part of functions.php looks like this: #include types require("includes/types.php"); #include ...
0
votes
0answers
29 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
0answers
28 views

Widgets not displaying since 4.3

I had some basic widgets registered and assigned to sidebars which were working prior to upgrading to WordPress 4.3. class Footer_Contact_Widget extends WP_Widget { public function __construct() ...
0
votes
0answers
6 views

How to replace a widget by editing it in the child theme?

I am fairly new to wordpress. I heard that changing a theme widget in the theme itself is not a good practise. I want to edit a certain widget by copying it into the child theme. The widget in the ...
0
votes
1answer
641 views

How to echo Widget Title in Custom Frontend-Template Box

I've created a custom Widget with the help of following code: // Creating the widget class wpb_widget extends WP_Widget { function __construct() { parent::__construct( // Base ID of ...
0
votes
1answer
643 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
26 views

Nonce and widget

I've been screening the code of several widget and haven't found any one of them handling nonce. I also took a look at the WP_Widget class and found nothing about it as well. This is from the codex: ...
1
vote
1answer
10 views

Widget - link to page rather than absolute url

When I add a link in a Widget, I get the standard Insert/edit link dialog with a Search field. If I enter the Page in the Search field and then link to this page using the "Or link to existing ...
1
vote
1answer
596 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
0
votes
1answer
16 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
26 views

display custom post type in widget aera

I am using https://wordpress.org/plugins/custom-post-type-ui/ plugin for custom post types. Now I need to display contact information in my footer area, email, phone num , address etc. For this I have ...
4
votes
4answers
3k views

Get number of widgets in sidebar

How can I get the number of widgets that are active on a specific sidebar? Is there a core function for this? I want to add a class to each widget on a sidebar based on how many of them are ...
1
vote
3answers
253 views

Widget Admin - Form Submit Event?

I'm creating a widget, and cannot figure out how to get an event right before the person clicks "save" or presses the enter button on the widget admin panel. What would be the javascript code to get ...
0
votes
2answers
623 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
417 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 ...
0
votes
0answers
13 views

Are dashboard widget settings global?

I followed the example of how to create a create a dashboard widget from WordPress' site to make a widget that reads an RSS feed and displays the items (yeah I know there are plugins that do this but ...
0
votes
1answer
412 views

“Widgets” menu doesn't appear

I'm developing a WordPress theme, which works great on my localhost and one of my live servers, but on my other live server the Widgets menu (from Appearance) doesn't appear. And yes, all 3 servers ...
0
votes
1answer
50 views

How to add image uploader to a custom widget?

I'v built a custom widget that will show some sport scores. Scores are added trough custom post. When i open new custom post(scores) i enter their team names, score, scores. Now i want to add an ...
0
votes
2answers
11 views

Redirect to page after a widget form submit

I have a widget form with custom fields like age,pincode etc.The submitted form data will be submitted through a 3rd party API which will output me JSON. Now I want to redirect to a page showing the ...
0
votes
0answers
22 views

After wordpress widget save (ajax call) tinymce editor gone, data not saved

I have made tinymce editor for textarea fields in widgets. I'm enquing scripts: wp_enqueue_script('tinymce', home_url() . '/wp-includes/js/tinymce/tinymce.min.js'); wp_enqueue_script('tiny', ...
0
votes
1answer
16 views

Custom post type not being pulled in widget

I am creating a widget that displays data from my post type 'testimonials'. The back end of the widget is working fine and displays a list of testimonials and allows me to select which I want to ...
0
votes
0answers
7 views

Ensure widget admin js fires in Widgets and Customizer

Doing a long-overdue update of a plugin. I have some JS that loads in the admin side to react when a user changes a select value in the widget options. $('#accordion-panel-widgets, ...
-1
votes
1answer
48 views

How to completely remove the sidebar?

I am custermising adamos theme with the WordPress web tool. I went to Appearance ==> Widgets, and removed everything in Primary Sidebar. But I still see ARCHIVES and META at the position of right ...
0
votes
1answer
499 views

Widget Option is Missing

My Widget Option is missing in the Dashboard area. How can i make that appear? I have downloaded this Blank Theme from Chris Coyiers site. sidebar.php <?php /** * @package WordPress * ...
0
votes
2answers
719 views

Change HTML structure for custom menu in sidebar

I've been digging for documentation on how to change HTML output for the "Custom menu" which you place in optional widget. So its clear what I meen I have attached an image of the widget block here: ...
0
votes
2answers
375 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
0answers
14 views

wp_dropdown_categories() in function form () doesnt work in page builder

I am creating my very fist widget which will show 5 post from certain category in a certain way on my wordpress site. I have main function ready with hardcoded category number in it and now I would ...
0
votes
1answer
30 views

Creating a widget with a number of custom fields

I am attempting to create some custom widgets. I have created one, which only needed a different title field. However I am now stuck when trying to create a widget which allows me to have multiple ...
4
votes
2answers
3k views

Add a custom walker to a menu created in a widget

I know how to add a Walker to a custom menu created by the theme (menu named primary in this example), but how can I target a menu thats created in a widget with the default wordpress custom menu ...
0
votes
1answer
24 views

Plugin Works, but Widget Doesn't

I really haven't got a clue here. I've been busily developing a custom WordPress site, using custom plugins and widgets for some of the custom functionality, and I've hit a snag. No matter what I ...
0
votes
0answers
16 views

Update the same widget in multiple sidebars

I have a fully functionnal widget with some inputs and I put this widget in a second sidebar. I want to know if it's possible to automatically update the second widget with all the informations ...
0
votes
1answer
23 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
0answers
8 views

Can't access global scope in widgets

How to set global/static variable inside of a widget function of a widget? I use this code: class MY_Widget extends WP_Widget { function widget( $args, $instance ) { global $myvar; ...
0
votes
1answer
16 views

Even with PHP plugin get_posts not working in widget area

I have the following code in a template, it and displays images form a custom field: <ul class="about-us-grid"> <li> <?php $posts = ...
3
votes
2answers
698 views

Full width layout for custom post type pages

I'm trying to remove a widget area called 'Primary' from a certain page on a site. This is the function where I manage the sidebars: //ADD CATEGORIES IN SIDEBAR OF SINGLE POST TYPE add_action( ...
1
vote
1answer
2k views

Widgets menu does not appear under “Appearance” in dashboard

I am developing a WordPress theme, but am stuck on widgetizing my theme. I have followed several tutorials but still cannot get it to work. My widgets menu does not appear under Appearance in my ...
0
votes
2answers
11 views

in_category('category-sluga') returns true for Archive page of Category 'category-slugb'

I've got a Category Archive page with name category-slugb.php. I have a sidebar with some Widget Logic that uses in_category('category-sluga'). What's odd is that on this Category Archive page (i.e. ...
0
votes
0answers
14 views

Update title of every instance of widget using text field

I have created a simple widget which looks like this: As there are going to be many instances of this I want to know if it's possible to update the title of each instance (where it says 'Membership ...
1
vote
1answer
47 views

How can hide widget title if custom widget is empty

I created my Custom Widget with a category filter select. The widget show me the related posts of the current taxonomy term and filter by the selected category. I would like to hide the widget title ...
0
votes
2answers
385 views

WAMP to XAMPP WordPress transfer

I want to switch a WordPress site from a wamp localhost to xampp localhost. Using the Tools > Export, I saved the WordPress content to an XML file. I did not create a similar backup of the MySQL ...
0
votes
1answer
30 views

how to run a php code in widget?

I have a code to get all taxonomies and terms for a single post: $object_terms = wp_get_object_terms($post->ID, 'staff', array('fields' => 'all')); if ($object_terms) { echo '<p>' . ...
0
votes
1answer
211 views

Update widget form after drag-and-drop “only specific plugin”

This solution, Update widget form after drag-and-drop, works correctly but I want to adapt this function to affect only a specific plugin and not every plugin. How could I do it?
0
votes
0answers
15 views

Modify default widgets

i want to add a class to the link inside the footer widgets. how can i do that ? I found a way to add a class to the widget it self but not to the link inside of it ! The concerned widget are ...
0
votes
0answers
6 views

How to add images to widget instance from backend

I am working on a project which has content(no posts) and I want to give complete control to user to change and edit content from admin panel. I have created widget added fields to it but I don't know ...
1
vote
1answer
24 views

How can i make WP_Query return post image and categories?

I have a sidebar widget that will display related posts based on a custom meta field. The query works, but its very wasteful. All i need is the post title, featured image and the categories of the ...
1
vote
1answer
81 views

Custom Widget Creating PHP Exception When Placed In Its Own PHP File

I have a custom plugin created and i have created a widget. At the moment this code is included in the base php file for the plugin and its working fine. I want to move the widget and all future ones ...
0
votes
0answers
10 views

WordPress returns incorrect timestamp in drip-feed widget

First off, yes I have contacted s2member support on this topic, but they have not been super helpful. Additionally, I'm not convinced this is an s2member plugin issue. Ok here goes: I'm working on a ...
0
votes
0answers
13 views

Get the sidebar title outside widget

I want to find a way to get the sidebar title outside of the widget area. My actual functions file: if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => __( ...