Questions tagged [widgets]
Widgets are configurable elements used to dynamically build sections of a WordPress theme.
2,093
questions
0
votes
0
answers
96
views
Using foreach loop for `$instance` of form and update array widget iteration
Can I use a foreach loop to iterate over the $instance array of a custom widget ? I'm trying to make my code less verbose, but I'm not able to use the loop to escape the inputs and to assign the keys ...
1
vote
0
answers
33
views
escaping and sanitizing input for custom widget form fields
Is there a better way to validate the form method inputs of a custom widget? I want to avoid to create a long list of control structure or variables.
For eample here is the code I've used for a ...
0
votes
1
answer
408
views
how do i remove a woo-commerce widget?
How do I remove that widget that is to the left of the screen, I want the product page to take the full width of the browser window and for the life of me cannot find out how to remove it.
It says ...
0
votes
1
answer
867
views
Widgets not showing on custom theme
I'm implementing some widget area inside my custom theme. I've noticed that the added widgets are not display where I want, It will appear a blank area, also if I create a custom sidebar template for ...
0
votes
1
answer
23
views
How to move top widget to the left - Responsive Theme WordPress
I have WordPress, responsive theme and whenever I upload a top widget, it stays a bit to the left from the header. How can I move the top widget to go close to the header image as in the picture?
The ...
1
vote
1
answer
109
views
WordPress keeps moving my widgets to other widget areas
I am currently developing a WooCommerce store, based on Astra with a lot of custom coding. I have noticed two or three times that my widgets were missing all of a sudden. In fact, they just got moved ...
1
vote
0
answers
95
views
changes to widget settings not showing up in individual pages pages until they're updated [closed]
I'm using a plugin to add a widget to my sidebar. That widget has some settings that I'm still fiddling with in order to get things right...
After adjusting the settings on the screen above and ...
1
vote
0
answers
222
views
Wordpress Shortcodes.. printf is outputting a random number... Can't figure out WHY?
As the subject states... why is this happening? I have the following shortcodes registered so that the user can easily create a slideshow within their content and widgets.
functions.php
function ...
1
vote
0
answers
29
views
Form link throwing website to main language
So this theme (Listeo) I'm using it's not natively multilang, so support doesn't help on this and I had to make some customization in the code.
Every time I'm on the second language (English), and I ...
0
votes
1
answer
485
views
How to add shortcode to html widget
I'm trying to include a shortcode to an html widget by adding below code to functions.php
add_filter( 'widget_text', 'shortcode_unautop');
add_filter( 'widget_text', 'do_shortcode');
and to the ...
0
votes
0
answers
206
views
How to disable a widget area of a specific page?
This is the widget available in my home page.^
This is the widget available in my pages.^
The question comes: I want to find a way to disable the "front page main widget area" in my pages but not my ...
0
votes
1
answer
1k
views
Widgets are not displaying in my theme
I am getting one issue on my WordPress theme.
Your theme has 2 other widget areas, but this particular page doesn’t display them. You can navigate to other pages on your site while using the ...
1
vote
2
answers
172
views
WooCommerce Multi-Currency shortcode not working [closed]
I've installed and activated WooCommerce Multi-Currency plugin. I'm still on the free version but I with that I can add two currencies. This works fine if I try to add the widget to the footer or ...
1
vote
1
answer
56
views
Prev / Next menu item
I have a menu on the right-hand side of my website https://blazor-university.com/
Above the menu I want a link for the previous menu item, and the next menu item. I can't find anything that does this....
0
votes
0
answers
29
views
An archive widget, coming from nowhere on my posts and pages
Pretty much, it looks like this:
And I really do not know where the "Acrhive" is coming from. This is how the Widget page looks like (either this way or the archive is set on the bottom):
obviously ...
1
vote
2
answers
516
views
WordPress category widget only show categories with children
I'm trying to modify the inbuilt WordPress category widget to only show categories if they have children.
I was using this code:
function exclude_widget_subcategories($args){
$all_categories = ...
0
votes
0
answers
23
views
One time call to external API in widget
I want to make only one call to external API in the 'my_widget' class
here is an example:
class my_widget extends WP_Widget {
public function __construct() {
$args = array(
'...
0
votes
1
answer
2k
views
how to make video autoplay in widget
I'm using .mp4 video in widget as an alternative for GIF to speed up my load time.
My question is, how can I make the video autoplay and looping without using a plugin?
0
votes
0
answers
476
views
URLs for (MultiSite) link images are always relative
How I can I get WordPress to stop making link-image URLs relative?
I'm trying to add logos to the blog-roll widget, but WordPress makes the URLs of the images relative to the current blog.
For ...
0
votes
0
answers
38
views
Add widget area from visual editor
Is it possible to add a widget area to a custom wordpress theme? I've read many guides and I'm finishing to build a custom theme that will embed a simple layout builder based on shortcodes. I have my ...
0
votes
1
answer
151
views
Change WordPress plugin widget `id_base` without breaking widget
I have developed a WordPress plugin, and one of the widgets in the plugin has a spelling error in the $id_base param of the parent::__construct method called in the Widget constructor. It seems that ...
0
votes
1
answer
22
views
Custom Page Template - Widgets of wrong sidebar
I have created a blog page and added some widgets to it. So far so good...
Than I created a custom page by putting a file with
/**
* Template Name: Shop
**/
<?php
/**
* Template Name: TWArms ...
0
votes
0
answers
123
views
Widget title showing below widget
I added a widget area to my sidebar using the following code. The area shows up fine, and I can add widgets which also show up and work fine. The problem I am having is if I add a title to the Widget, ...
1
vote
1
answer
185
views
Wordpress Widget Multiselect Issue
I am building my Wordpress Widget and I ran into an issue that I am not able to find a solution for.
The widget is a simple one: that displays the last 10 posts in my CPT filtered by Category.
The ...
0
votes
1
answer
109
views
Archive Widget - Count only parent posts
I'm currently using a filter applied to the Archive Widget.
It's successfully filtering posts from the specific category (26) but now I also want to filter only PARENT posts, in order to count only ...
0
votes
1
answer
544
views
Elementor or Wordpress randomly adds the word “array” to my custom widget
I'm building a custom widget for elementor to help my client add items to the website on his own without coding knowledge. I almost had it finished when I ran into a very strange issue. A button I ...
0
votes
0
answers
100
views
Widget form not displaying for media widgets in WordPress
I am creating a plugin where I want to display the widget's form using the following code. Widget form for media widgets is not being displayed while other widget's form is being displayed perfectly. ...
0
votes
1
answer
31
views
Widget Title is not saving in backend
I have developed a widget to show latest news. The widget functionality is working correctly but the problem is the Widget title is not saving in backend. What is the right way to do it?
class ...
0
votes
1
answer
198
views
Can't Target a Widget's Elements using jQuery
I have a sidebar widget that has some elements inside I'd like to modify. The widget generates it's code from the "Action Network", so the content of the widget is loaded dynamically from another site ...
0
votes
1
answer
182
views
Two types of product categories on shop page
I'm hoping someone can help me out with what i'm trying to do currently.
I'm using widgets to show the categories on my shop page, and I want to add two types of product categories in it. The first ...
0
votes
0
answers
213
views
Collapsible product categories on sidebar?
I'm trying to find out how to make a collapsible product categories on the product page sidebar. I'm using woocommerce and the Avada theme.
I've tried scouring google to find a plugin for this or ...
0
votes
1
answer
1k
views
Display current post position in Elementor Posts widget
I'm using Elementor 2.6.8 + Elementor Pro 2.6.2
I'm designing an Archive template to display a list of Custom Post Types filtered by custom taxonomy terms.
I'm using Posts Widget from Elementor Pro ...
0
votes
1
answer
42
views
How do I deactivate widgets by name?
I cna get list of widgets with
wp widget list sidebar-1
| search | search-2 | 1 | {"title":""}
| recent-posts | recent-posts-2 | 2 | {"title":"","number":5}
| recent-comments ...
0
votes
1
answer
242
views
Need help removing block of white space between footer widgets and footer [closed]
This is the page in question:
https://k-12readinglist.com/category/reading-lists-for-elementary-school-children/
There's a large space between the footer widget areas (which are empty) and the ...
1
vote
1
answer
27
views
Is there an official email form widget or block?
I want to add an email form to a wordpress site, but all of the existing ones I see are from third parties.
Doesn't Wordpress offer an official email form to add as a widget or block?
0
votes
0
answers
753
views
Display Login user name in Thim:login Popup widget
I want to display username in widget i used the code provided by https://wordpress.stackexchange.com/a/196467/168204
its working but i want to do same for widget and its not working Please help with ...
0
votes
1
answer
2k
views
Add class to <ul> on sidebar widget
I have been looking on stack overflow and the web but can't find a simple solution for this.
I just want to add a class to the of the widget sidebar generated by Wordpress.
This is my register ...
0
votes
1
answer
59
views
Make Widget appear on Dashboard
I recently created a widget in my functions.php with following code :
register_sidebar(
array(
'name' => __( 'Informations importantes', 'twentynineteen' ),
'id' ...
0
votes
1
answer
257
views
How to add post type in masonry posts elementory widget
When I try to create a website using Wordpress 5.2.2. I found a widget called Masonry Posts in Elementor Panel. But when I added the widget and checked there is no option to choose the post type. We ...
2
votes
1
answer
239
views
WordPress tag cloud add more links
Due to location constraints, the Tag Cloud widget settings display 30 tags. Can I insert a custom link at the end of the tag cloud? So that I can link to a tag archive page.
Thanks in advance!
0
votes
1
answer
58
views
My website is not showing Footer section
** EDITED **
Hello im new with Wordpress, Im having a problem with widgets (sidebar and footer) my footer.php is not being rendering unless I delete sidebar.php from files.
Ive tryed to debug but ...
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, ...
0
votes
1
answer
472
views
Co-author plus: list of posts by authors in the sidebar
I am using co-author plus. I would like to display all/recent posts by authors of a post in the sidebar. Is there a way of doing that? Plugins like Author Recent Posts do not work with Co-author plus.
...
0
votes
1
answer
379
views
Extend WordPress Audio Widget to accept HLS (.m3u8) URLs
I'm working on a new FM radio station website, I was trying to use the default WordPress Audio Widget to play their live audio stream.
The problem was that the Insert from URL option doesn't accept ....
1
vote
1
answer
67
views
Drafts widget for admin page
The Quick Draft widget on the admin dashboard has an area to create a new post and a list of recent drafts. I'd like a widget like this but with ONLY a list of recent drafts. Surprisingly, I couldn'...
1
vote
1
answer
66
views
How to allow your custom widget as block in gutemberg editor
I would like to add a widget in gutemberg as block like this :
Is there a way to do it instead of using a shortcode ?
0
votes
1
answer
41
views
Searching for a one page overview widget
I am currently using the Lodestar theme. My website is built up in a way that the navigation bar at the top leads you to different pages which have a one-page static structure.
To allow for ...
0
votes
0
answers
543
views
Sorting Tag Cloud by Popularity
So I have the default Wordpress Tag Cloud Widget on my sidebar/footer and I found the following code to limit the number that it's showing because it took up a ton of space. This code however is not ...
0
votes
1
answer
364
views
Can't get wpColorPicker to work in a widget
I can show the color picker, I can change the color and see the save button watching that, however nothing is saved to DB and I'm getting
Undefined index: my_color", file:
"wp-content/plugins/...
1
vote
1
answer
125
views
How to hide CSS by default and show on button press
I have the Elementor Pro page builder plugin installed and I want to setup a expanding column so when a button is pressed it expands more Elementor sections.
I'm pretty certain this can be done with ...