Questions tagged [widgets]

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

Filter by
Sorted by
Tagged with
0
votes
0answers
11 views

How do I edit a widget? [closed]

I want to keep the button at the bottom and remove the search boxes at the top. Is this possible?
0
votes
1answer
18 views

How can I have sidebar widgets on Twenty Seventeen theme on all pages?

How can I have sidebar widgets on Twenty Seventeen theme on all pages? Right now it's possible only on Blog page, not on any other page. Thanks for any help, Afan
0
votes
1answer
22 views

How to output only blockquotes content from recent posts in a widget?

I created a simple widget that displays recent post titles. How can I only display the content that is between < blockquote >< /blockquote > from recent posts? For example, all my posts have a ...
0
votes
0answers
14 views

Text widget is placing everything side by side. I want to post it above

As I add text widgets within a page in my home screen, They are going side by side. I have three text widgets as if there are three columns of text in my page. I like this, but i want to put a title ...
0
votes
0answers
13 views

Load Taxonomy terms based on Post Type selection

I am creating a widget.I want to get Taxonomy Terms with the selection of Post Type in dropdown list. When a Post Type is selected from dropdown list, the related Terms/categories of that Post type ...
0
votes
0answers
19 views

How to hide the side widget and make it shown only on content?

.wte-trip-facts { display: none; } I tried this one but it made the widget disappear in content too. See in this page https://pristinenepal.com/trip/upper-mustang-trek/. see the trip facts
0
votes
1answer
62 views

Uncaught Error: Call to undefined function wp_get_current_user() in

My simple plugin gives error: // Class wpb_widget ends here add_action('init','do_stuff'); function TopAuthor() { $contributor_ids = get_users( array( 'fields' => '...
1
vote
1answer
36 views

Adding widget to dashboard with wp_dashboard_setup not working

I just separated my functions.php file into smaller files and the required each of those inside functions.php One of those files is 'dashboard.php' where I add a widget to change a notice in my shop. ...
1
vote
1answer
165 views

Ajax gives 400 error

Basically I am trying to fire an ajax call in an Elementor widget. So I have a button on the click it executes a function in the widget class. To elementor basic template I have added this. ...
0
votes
0answers
4 views

Hi guys, I am having some issues with the stock Wordpress calendar widget?

I have a very basic blog website and added the calendar widget ages ago, it has always worked. A few weeks it just stopped and all links (even though they are correct) somehow redirect just back to ...
0
votes
0answers
11 views

Manage custom form with an upload field on widget frontend

I want to create a particular component for my theme, the component is supposed to be a form to display on the front-end to logged in users only and will give the user the ability to upload zip/rar, ...
0
votes
1answer
25 views

Load script on frontend from widget plugin

I need a bit of help for a plugin I'm writing. I need to load a custom stylesheet and a custom script that are needed on the frontend only. Usually I use the wp_enqueue_script and wp_enqueue_style ...
0
votes
0answers
16 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
0answers
15 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
1answer
20 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
0answers
8 views

open media libray in custom widget

I've read a nice tutorial on how to implement the media libray to select or upload images as a background of a custom widget, but I have a problem, the media library will not open and I will get also ...
0
votes
0answers
7 views

Open media library from custom widget

I have made my first custom widget by following the guidelines of the theme handbook. It's not perfect but working nice, I have only some problems with the $args variable that was set on the ...
0
votes
1answer
22 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
0answers
10 views

Add multiple widget area for custom info

I want to setup some widget areas in the footer and on another part of my custom theme. I'm using this code, but I'm not sure if it will work correctly. ehat I expect is to have the ability to put ...
0
votes
1answer
15 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
1answer
11 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
0answers
28 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 ...
0
votes
1answer
16 views

why the code html apear in this widget in footer

i don't know why i have the code html appear in home page like this in picture. Thank you in advance
1
vote
0answers
25 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
0answers
14 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
1answer
33 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
0answers
25 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
1answer
44 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 ...
0
votes
0answers
18 views

Widgets: quote of the day, text rotator, customizable tag cloud

I would like to have three widgets in my footer: 1) Quote of the day - every day would display a different quote from my own quote database. 2) How can you help us? - would display every few seconds a ...
1
vote
1answer
21 views

WooCommerce Multi-Currency shortcode not working

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
1answer
19 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
0answers
20 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
2answers
35 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
0answers
11 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
1answer
44 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
0answers
29 views

Add Custom Attribute and Class to Image and Gallery Widgets IMG Tag

I'm trying to use lazyload javascript library (LazySizes) to my WordPress site and some of the LazySizes JS plugin requirement is to replace the 'img' attribute with 'data-img' attribute and also to ...
0
votes
0answers
18 views

Display authors on most recent posts widget

I would like a widget which shows the author (or the authors, with coauthors_plus) below the most recent posts (along with their dates). Is it possible? I have been looking for it here and on Google ...
0
votes
0answers
38 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
0answers
26 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
0answers
40 views

when to use the Wp customizer and when to use Wp widget?

im new to wordpress dev and im a little bit confused about building component like Call to action or search bar , should i use customizer or widget , and what is the pro and cons of both of them
0
votes
0answers
12 views

How to get settings of widget before rendering?

I would like to do something in a widget before any HTML renderering takes place, and I need it's settings. Using the widget() method is already too late. I tried something like this, from constructor:...
0
votes
1answer
57 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
1answer
14 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
0answers
35 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
1answer
49 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
0answers
12 views

Add footer inside the content of pages

I currently have a page where my background is just a gradient color from bottom to top. With the header there is a option : Basic 1 - inside header. This puts the header together with the content ...
0
votes
0answers
12 views

Easy way to create a “add comment ” widget for a special post?

is there a easy way to create a "add comment " widget for a special post ? so whith it, a user can add a comment directly from home page to this post. Please...help
0
votes
1answer
33 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
1answer
72 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
0answers
40 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. ...