Questions tagged [widgets]

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

Filter by
Sorted by
Tagged with
0 votes
1 answer
29 views

WordPress PHP8.2 Critical Error in class-wp-widget.php

Recently updated to PHP8.2 and I'm getting a critical error related to the theme. The critical error is: Fatal error: Uncaught ArgumentCountError: Too few arguments to function WP_Widget::__construct()...
0 votes
1 answer
829 views

How To Create Dynamic Permalink To Custom Taxonomy List of Current Posts?

I'm looking for help with a problem I've run into and can't seem to workout myself. I have created my own custom taxonomy called series (code below). I am calling the custom taxonomy posts in a widget ...
1 vote
1 answer
7k views

How to add widget in main menu

I want to display widgets in main menu. There are few plugins to do this and i already used in my previous projects. But now i want do without any plugin. I can create a custom sidebar and call this ...
0 votes
1 answer
705 views

How to filter the widgets like calendar and archives based on category in WordPress

Thanks for the reply now the news page and blog page of my website has sidebars to specific to those, but now the new problem raised on the widgets side. Specifically Calendar and Archive widget are ...
0 votes
1 answer
18 views

How to add the custom icon for elementor widget [closed]

I am developing a custom widget for the Elementor editor in Wordpress. I want to set the custom widget icon, the Elementor provides the get_icon function in that we have to return the class which has :...
2 votes
1 answer
2k views

woocommerce featured products and categories

I am working with woocommerce at the minute, and the design requires to show a number of featured products and categories in a number of different styles. For example one featured product needs to ...
0 votes
0 answers
346 views

how to check elementor is widget is active or loaded

I have create a custom widget for Elementor. I want to check with the code whether my widget is used or loaded (active) on the page or not? How can I do this? I want the styles related to the widget ...
0 votes
1 answer
2k views

Tabs widget from Elementor is not showing the content in it to users. But at admin side it is working fine

As you can see in attached screenshot it is just showing the title name of tabs nothing else. By clicking on the titles nothing it will do. So, This is how users having experience. It is working and ...
0 votes
1 answer
673 views

Integration widget Mondial Relay Js

Could you help me please: I have to integrate the code of Mondial Relay but I do not know where I have to integrate it. Thanks a lot The code is : <!--On charge Google Map API--> ...
0 votes
2 answers
1k views

Add Control in Widgets Sub-Panel in Customizer

Is it possible to add controls to sub panels of the widgets panel in the customizer? If yes, how do I address them? The widget area would be named “top-widget-area” Neither addressing: 'panel' => ...
4 votes
3 answers
13k views

How to Remove All Widgets from Dashboard?

I'm looking for a complete blank Dashboard. No widgets at all and preferably one column. There are snippets to remove the default WordPress widgets but haven't found anything about the ones added ...
0 votes
1 answer
903 views

Adding widget to sidebar which contains current page's submenu

Need to insert the sub menu of the current page into the current page's sidebar. Is this possible? What I'm interested in developing would be a menu that looks like this: menuItem1 => subitem1, ...
1 vote
2 answers
2k 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 ...
1 vote
2 answers
2k views

Is it possible to display tag cloud widget by category?

Is it possible that Tag Cloud Widget will show only tags by category? If a single post is from sports category, then the Tag Cloud Widget will only show tags about sports.
2 votes
2 answers
2k views

Multisite Widget/Content

I'm using WordPress multisite and need to display content across all subsites in the sidebar. This is a network of 50+ sites so updating all 50+ sidebars with this content every few days is not ...
0 votes
0 answers
12 views

RSS Feed Button not showing

I am trying to add follow feature of RSS feed so that other people can follow my RSS feed to get updated. I am trying this with adding widget and in that widget I choose the RSS feed. and I am using ...
1 vote
2 answers
1k views

How a HTML form can trigger a PHP function?

I'm new to the Wordpress/PHP world. I want my page be able to communicate with an API that I build myself. So for this I have a form on my Wordpress Page using a HTML code widget which looks like this:...
0 votes
1 answer
3k views

Widget logic using woocommerce product category

orry my question was not clear. I have different category and sub-category.Each categories has sub categories ie. car-cosmetic -cream -soap household -cleaner -etc. I would like to display the ...
0 votes
1 answer
738 views

Are WordPress widgets cached?

I'm not sure if it is true but seems that the content of the widgets is cached. I initially thought there was a problem with my code (I need to hide/show a section in a custom widget according to a ...
0 votes
0 answers
15 views

ACF true/false field in a custom dashboard widget?

I have a true/false ACF field a setting on my site. I was thinking that instead of burying it in an options page I could create a dashboard widget so it can be toggled on and off right from the main ...
0 votes
1 answer
14 views

Create custom dashboard for plugin

I am trying to create in admin area my own Dashboard for my plugin. Only article I found is an example in WP Developer Resources but the widgets cannot be moved. I suspect that loading script code in ...
0 votes
1 answer
1k views

Add checkbox in admin post list - show checked post in widget

I try to make a plugin with a widget where I can mark / check posts, maybe old post I want to bring back to life. I want to add a checkbox in the field before the title, like I try to show in the ...
0 votes
2 answers
1k views

Hide widget on page

How can I hide a widget from a certain page (one page). After spending an hour, all I can find is with the plugins. The problem is, that I know with them how to do it, but one widget (ad widget) is ...
5 votes
2 answers
2k views

How to refresh Theme Customizer after change color inside wpColorPicker?

I develop my custom widget with setting where I can set up custom color for the widget. I use this code to initialize wpColorPicker instead of default text input in form() method of Widget class: ...
0 votes
2 answers
2k views

Show or hide custom menu widget in side bar conditionally

I have been trying and searching to accomplish this. I have the "custom menu" widgets "Members Area", "Admin Area" in side bar, assigned menus to them. Fine, they display. I want to show "Admin Area" ...
1 vote
2 answers
1k views

wp_editor in widget breaks after save (no buttons and visual tab broken)

My goal is to get wp_editor working in a simple widget which the admin can use to add text content on an admin options page. Here we go in wp-admin/widgets.php everything looks sooo good right. When ...
5 votes
1 answer
2k 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
2 answers
3k views

How to get sidebar widgets in leftsidebar template

I have created a custom sidebar widgets using below code : register_sidebar(array( 'id' => 'sidebar-widget-1', 'name' => 'Sidebar Widget 1', 'before_widget' => '', ...
2 votes
1 answer
7k views

How do I add Widgets to my theme and activate them on my site?

I registered the widget area in my functions.php and they appear in my admin area but when I drag it over to the right hand panel to make changes none of them seem to do anything. Anyone know what I ...
0 votes
2 answers
7k views

How to get widget content in Wordpress based on it's ID?

I need to parse widget content based on it's ID. But a widget works like a function that pulls data based on it's arguments, right? So when I pull the widget data, I can only get it's arguments, not ...
0 votes
1 answer
1k views

How to show a feed that requires user/pass within a sidebar widget?

I'm trying to do something and I don't seem to yield any successful results when searching neither at wordpress.org forums nor here. I would like to extend the standard RSS widget so that I can set ...
2 votes
2 answers
2k 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( '...
0 votes
1 answer
69 views

SVG Icon Code Support in WordPress Custom Html Widget? Not Working

I am Trying to Add SVG Icon Code in Custom HTML Widget, it is not working showing following error "There is 1 error which must be fixed before you can save.". How we can fix it without ...
0 votes
0 answers
11 views

Blank widgets page after core update - which files to purge cache?

When I update my WordPress network's core version I often find my sites have a blank widgets admin page. Dev console shows a lot of JS errors. This is fixed by doing a full cache purge of the domain, ...
0 votes
1 answer
3k views

how to get value of a select box in custom widget wordpress

I am trying to make a custom widget. My codes are as follows: class techno_widget extends WP_Widget { function __construct() { parent::__construct( 'techno_widget', __('Recent ...
0 votes
1 answer
22 views

Exclude category in widget through child theme

I desperately try to exclude categories through following snippet in my functions.php of my child theme: <?php //https://developer.wordpress.org/themes/advanced-topics/child-themes/#how-to-create-a-...
0 votes
1 answer
639 views

How do I add footer widgets to the StudioPress Monochrome Pro theme?

I spent all day creating a custom theme based on the Monochrome Pro Genesis child theme. But, I just noticed it doesn't have any footer widgets areas in Appearance > Widgets. I looked at the theme ...
0 votes
1 answer
26 views

Create side bar widget showing list of years as hyperlinks for a custom post type

I have a WP site using Elementor Pro. I have created a Custom Post Type called "Meeting" I have created an archive page for "Meetings" using a Loop Grid To display the post ...
0 votes
1 answer
791 views

How to add styling and script to a custom widget plugin

I just created a new custom widget with the following code that is in a file under my plugins folder: <?php /* Plugin Name: New Calendar Plugin URI: http://www.web2web.co.za Description: Add the ...
3 votes
6 answers
9k views

Shortcode from a widget is wrapped in unwanted <p> element

I'm using Black Studio TinyMCE Widget as a rich text editor widget. In a sidebar I inserted the TinyMCE widget with a [testimonial] shortcode and some content after it. For example: [testimonial] ...
1 vote
1 answer
810 views

Custom Widget WP_Query problem

I have everything working on my widget except the results! I created a taxonomy called country names that we use for several custom post types. I created this widget to display tour guides (CPT) from ...
1 vote
1 answer
883 views

How to add multiple footer widgets?

I am new to WordPress. I would am currently using the Twenty Seventeen Theme. I would like to add multiple Footer Widgets, however WordPress is limiting me to only two. Is it possible to add a few ...
0 votes
3 answers
3k views

Display widget outside sidebar?

I want to display a widget outside the sidebar, but I can't get my code to work. The theme name is radius-primary-sidebar and my widget id is text-20 (according to the html in the admin page. See ...
3 votes
2 answers
795 views

How to target the default Recent Posts and Recent Comments widgets with pre_get_posts?

I added the following to my functions.php: add_action('pre_get_posts', 'keyl_get_emp_posts'); function keyl_get_emp_posts($query) { if ($query->is_main_query()) $query->set('...
0 votes
1 answer
1k views

Non-static method error when trying to use class in widgets

I'm trying to call a method into a function widget. The $this of the widget is passed to that method, but I get the following error: Strict Standards: Non-static method class_name::method_name() ...
0 votes
0 answers
17 views

$_POST[] variable is inaccessible in block editor. Is there any workaround?

I am building a legacy widget where I need to access some checkbox values added to the DOM in runtime using client script. For example: <input id="groups-2-523221" type="checkbox&...
0 votes
0 answers
26 views

How to know the Post Data Object in block editor when I hit the Update button

I need to see the Post Data that is being submitted when I hit the Update button of the block widget. I want to print this object in JavaScript console so that I can inspect the data. The reason for ...
1 vote
1 answer
672 views

Wordpress Widget - Saving multidimensional arrays into $instance

In my wp widget, $instance has an attribute called order which will the listing order of libraries/services. I'd like to store a multidimensional associative array that will hold the id of each ...
0 votes
1 answer
158 views

Users as team members through a loop in elementor

I am trying to create a loop in Elementor's theme builder that will display each user with the role of the Contributor or Author. I.E. When the admin of the website will add a new user with the above ...
1 vote
2 answers
2k views

Text widget doesn't save the content

I am trying to save data in the default text widget. But when I click save, all the data are not saving and the field becomes empty. It happens when I edit in title field or text field. As I new to ...

1
2 3 4 5
42