Questions tagged [widgets]
Widgets are configurable elements used to dynamically build sections of a WordPress theme.
2,092
questions
0
votes
1
answer
16
views
How to add the custom icon for elementor widget
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 :...
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 ...
0
votes
0
answers
13
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
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
20
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
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
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
25
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 ...
0
votes
0
answers
15
views
Accordion takes longer to collapse when placed in a block widget editor
I am facing a strange issue with my plugin. It can also be placed as a block when block widget mode is activated. The plugin has an accordion with four containers. Each container has its own form and ...
0
votes
1
answer
27
views
how can i modify the default wordpress sidebar
I need to hide the Uncategorized category from the default sidebar.
I edited the file wp-includes/widgets/class-wp-widget-categories.php, but I did not see any changes. Here is an image of my sidebar, ...
0
votes
0
answers
19
views
Selecting what blocks are allowed in core/edit-widgets by sidebar ID
I am looking to control what blocks are available to the user in the "block-based widget area". I see this as the perfect area for handling things such as contact numbers, and alert messages ...
0
votes
1
answer
34
views
How to insert a block in a widget which links to a entry/page
I'd like to insert a link in a widget to a blog entry or page. The link's text should be the entry's/page's title.
As stated here, it's currently not possible to use the navigation block in a widget ...
0
votes
1
answer
20
views
Using a custom widget to add data from a custom post type into the sidebar
A while ago I found a theme called “Games Zone”, by Themefuse, that used a custom widget to add information from a custom post type into the sidebar of a post. I spent some time tearing down the code ...
0
votes
0
answers
24
views
Multiple wp.editor in a custom widget using JQuery
Hi I'm trying to build a custom accordion widget with the possibility to add multiples panels with WYSIWYG editor. My issue is that the editor content from the javascript is not saved in my widget $...
0
votes
0
answers
24
views
Image inside the content is replaced with featured image from my older post
I'm trying to create a popular posts widget and display the images via this function:
function vp_get_thumb_url($post, $text, $size){
$imageurl="";
// 1) FEATURED IMAGE
// ...
0
votes
1
answer
16
views
How to add the "page" post type to Recent Activity widget displayed in admin?
I already know how to custom the default Recent Activity widget displayed in Dashboard in order to show the last Custom Post Types published :
add_filter( 'dashboard_recent_posts_query_args', function(...
0
votes
1
answer
148
views
Why my widget is not visible in the Wordpress theme Twenty Twenty-Three
Why my widget is not visible in the Wordpress theme Twenty Twenty-Three ? in other wordpress themes that I have tried it can be used normally. even though the plugin is normally installed, the widget ...
0
votes
1
answer
151
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 ...
0
votes
1
answer
23
views
Custom dashboard widget - load style only for added widget
I'm writing a custom dashboard plugin using vue js and boostrap 5. I've noticed that bootstrap will be loaded for all the dashboard and I want to use it only to style my dashboard widget. My question ...
0
votes
1
answer
45
views
Output number of Wordpress posts remaining until a post milestone is reached
Some time ago there was a Wordpress plugin (Post Countdown) that created a widget to display how many posts there were still to be published before a milestone was reached. As of PHP8 it no longer ...
0
votes
0
answers
342
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 ...
1
vote
0
answers
18
views
Add custom settings to widget areas
I'd like to add settings to sidebars defined in my custom theme - sometimes, for example, I'd like to be able to set a widget area to not display. Is this possible, I can't find any references for it?
0
votes
0
answers
66
views
How to edit a widget code?
I use a Latest Portfolio widget, but it can show max 20, but I need 30. While using Inspector, I can see the counter from 1-20, but cannot figure out which file has it. I viewed almost all files but ...
0
votes
0
answers
35
views
Can't edit the widgets sidebar or footer
Why can't I edit my widgets sidebar ?
website can be found here.
0
votes
0
answers
30
views
Theme Widget Area Defaults
In my custom theme's function.php file, I have created a widget area:
function my_footer_widget_area() {
$args = array(
'id' => 'footer_widget_area',
'class' => '...
0
votes
1
answer
242
views
How can I add a zip code service availability checker in Wordpress without Woocommerce? [closed]
The website is for a business that only provides services in certain zip codes. I would like to be able to display different messages based on if the zip code matches one in my list or not.
I couldn't ...
0
votes
0
answers
153
views
Hide empty categories on widget
I excluded some products from woocommerce_product_query with this code:
function en_archive_products_by_rol( $query ) {
if (is_admin()) {
return;
}
$meta_query = (...
3
votes
1
answer
328
views
getBlockVariations(…) is undefined in Widget and Template Part editors but not Post Editor
I'm using this technique to hide various embed blocks:
wp.domReady( function() {
/*
* Hide Embed Variations
*/
wp.blocks.getBlockVariations('core/embed').forEach(function (embed) {
...
2
votes
1
answer
93
views
Swap Wordpress "Widget Area" based on Page Template
i'm using 3 widget areas in my child theme's footer.
i created a secondary custom theme successfully, and am hoping i can simply change those 3 widget area's out in the second theme.
"Footer - ...
0
votes
0
answers
9
views
Hiding Widget On Mobile Devices Removes Our Product Search Box On Mobiles
We have a live search product bar on our website, which sits in the right hand sidebar on desktop versions, and we have some custom css which places it at the top on mobile devices, as it would ...
6
votes
1
answer
518
views
Is it possible to add Custom Dashboard Widgets to Custom Admin Menu Page?
TL;DR : In simple terms, I just want to add a Dashboard Widget created by our plugin using wp_add_dashboard_widget function, to a custom Admin Menu Page created by the same plugin using add_menu_page ...
0
votes
1
answer
80
views
How to tell if a dynamic sidebar is being displayed on page?
I'm trying to conditionally add a class of has-sidebar to a wrapper div, and I'm struggling to find a conditional statement to see if the sidebar is active on the current page.
For example:
<!-- ...
0
votes
2
answers
393
views
Remove nofollow attribute from social widget links
My footer social icons widget includes a nofollow attribute in links to my social media pages. I cannot find an option to turn this off. How might I remove this attribute either with a setting or ...
0
votes
1
answer
67
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
36
views
Issue with customizer and widget page
I have a wordpress website with hair and beauty theme, for some reason the customizer and widget page in wp-admin are not working and giving 404 error,
i tried the following things so far
check ...
0
votes
0
answers
14
views
is it possible to create custom widgets page in admin?
I am currently programming a WordPress theme
And I'm thinking of adding ads control places in the widgets (using register_sidebar, but at the moment the widgets appear in one place without ...
1
vote
1
answer
168
views
How to use apply_filters('get_calendar') to change get_calendar() output?
I am completely new in using apply_filters() while making a theme.
I use a standard Wordpress widget to display calendar.
However i need to change his HTML output to get a link button to current month ...
0
votes
1
answer
40
views
Filter widget_pages_args not working in Pages Widget
I try to use a filter to remove some pages from Widget Pages but it seems not to be working. What I am doing wrong?
add_filter( 'widget_pages_args', 'custom_list_pages_filter', 10, 1 );
function ...
1
vote
1
answer
30
views
Classic widgets with 5.9+?
This widget prints Hello Widget and works with many versions of WordPress including 5.8.4, but with 5.9.1, 5.9.3 or 6.0.1 (all with classic-widgets 0.3 installed) it appears the widget() method never ...
1
vote
0
answers
39
views
Footer option is missing in Customiser
Below is my dashboard screenshot, I don't see the footer option in my customizer. I have struggled a lot to research on this but no luck.
Can anybody please help me with this? how can I show the ...
0
votes
0
answers
284
views
Creating New Dynamic Fields for a Certificate (Number Generation, Code Referencing, and more)
I'm making a certificate that's supposed to autogenerate and involves the need for multiple dynamic fields. I have everything else finished but I have difficulty trying to create 3 dynamic fields. ...
0
votes
0
answers
38
views
Widget block editor: Unable to collect checkbox values inside widget update() method
Users can select an item from the list (the items are actually listed inside a DIV container). Upon selection, the item is added below with a leading checkbox in checked mode. When saved, the items ...
0
votes
0
answers
49
views
How do I remove lazyloading on the mh-spotlight-widget
What is the easiest way to disable native lazy load without a plugin for a specific widget in WordPress? I can't find anything at all about this question that I could use for functions.php?
// XX = ...
0
votes
1
answer
181
views
Problem extending a core block
I need to make a search block by creating a new instance of the core / search block (a basic wordpress block). I tried with the registerBlockType function with which I get this error message:
...
0
votes
1
answer
59
views
Inject "fake" category to widget/block
I have a regular categories widget (or "block" in the new terminology), that creates a <ul> with my categories.
I want to add a fake category for linkbuilding reasons, an entry to ...
1
vote
1
answer
99
views
Unable to locate inline CSS causing parts of page to be blank
Large parts on a live Wordpress page shows blank because a piece of inline CSS has opacity set to 0. Unfortunately I am unable to find where this inline CSS lives.
<div class="grve-element ...
4
votes
3
answers
15k
views
WordPress 6.0 class-wp-widget.php fatal errors in PHP 8.1.6
/wp-includes/class-wp-widget.php gives me an error for one blog, but not the other, and both have the same version of class-wp-widget.php which makes no sense to me.
PHP Fatal error: Uncaught ...
0
votes
1
answer
315
views
Table of contents (TOC) plugin is not showing header tag
I made a post template using meta box(custom field). If I put data into metabox, the template part (contents with h2, h3, p) shows up at the bottom of post (not on post edit page). However, every TOC ...
1
vote
1
answer
209
views
isSavingPost() for widgets
I want to get the block ID of my widgets (e.g. #block-1, which is displayed on the frontend after saving a widget) on the widgets screen in the backend. What I try to achieve is to display the ID of ...