Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [widgets]

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

1
vote
1answer
6 views

How to add multiple custom widget areas

I'm looking to add multiple widget areas to a page in my theme as id like to have widgets within certain pages. I can add one using this code, I'm just struggling with a second. function ...
0
votes
0answers
21 views

How to custom a widget class in Style.css file?

I am a newbie here. I could custom a feed via widget/RSS plugins or additional CSS. But while I add directly in style.css, it didn't work. I have read a similar question "Custom CSS for a particular ...
0
votes
0answers
10 views

How to use widget options as a shortcode?

I have function that convert widget options to shortcodes args. abstract class MOD_Widget extends WP_Widget { [...] [...] public function params_to_shortcode( $params ) { $...
0
votes
0answers
14 views

Convert PHP/Javascript to Widget

I'm going to preface this by saying I am new to Wordpress development, and have never had to use AJAX or JQuery, which if what I have read is correct, this should be able to be accomplished with. The ...
0
votes
0answers
7 views

How to show other options when selecting certain option on custom widget?

Please have a look at an image and you will understand my problem clearly. I have custom widget to display the posts. As you can see image, i have layout of posts listing. Layout One and Layout two. ...
1
vote
2answers
26 views

Show post number in widget loop

It works in the category.php loop <article> <p>post-<?php echo $wp_query->current_post +1; ?></p> </article> <article> <p>post-<?php echo $wp_query-&...
0
votes
0answers
14 views

Make bootstrap carousel dynamic in Elementor Widget

I want to have a quick solution. I am not good at backbone.js so I am getting little trouble here. Here is my code: https://pastebin.com/KB4vhkkY I have made a widget for Elementor for a bootstrap ...
1
vote
1answer
47 views

How to save widget fields generated from an array?

I created simple php abstract widget class that can generate form with fields from an array. When I try to save fields, all changes are removed. Abstract Widget Class: <?php /** * Abstract ...
-1
votes
0answers
6 views

Jetpack 'Blog Subscription' widget doesn't add emails to

I'm trying to use the jetpack 'Blog Subscriptions' widget, but any emails submitted with this widget aren't being added to the followers list. Verification emails aren't being sent to the subscribers ...
0
votes
0answers
15 views

How to allow publishers to set an article on homepage

I have a wordpress with publishers. -All publishers should be able to (re-)define one article as "homepage article"; -Only one article can be defined as "homepage article"; -Publishers must not ...
0
votes
0answers
15 views

Rewrite html of widget display-posts

I use the widget display-posts with this shortcode: [display-posts category_display="true" category_label="" category="homepage" include_excerpt="true" excerpt_length="200" include_excerpt="true" ...
-1
votes
1answer
9 views

Recent posts with different class name for each post and a scrollbar?

So far i found a widget ("Ultimate Posts Widget") with different class name for each post but it has no scroll bar.. any other widget suggestions ?
0
votes
0answers
9 views

Can view Social Media buttons only in the private mode - why?

I can view and click all the Social Media buttons: Twitter, Pinterest, Google and more plus the Like button in the footer but only when I am in a private browsing. If I browse as usual (not private) ...
0
votes
0answers
23 views

Woocommerce recently viewed products and page caching

I am currently using Hummingbird to cache my pages and I also use the Woocommerce recently viewed products widget. I am currently having to exclude my homepage from caching as when caching is active, ...
-1
votes
0answers
19 views

Menu and widgets not showing on frontpage

Yesterday I amended a certain widget, but now all widgets AND menu AND footer doesn't show up anymore on my frontpage. I do not have this issue on the other pages. In meantime I have deleted this ...
1
vote
0answers
9 views

Conditional Tags Based on Previously Viewed Posts

I was looking at the Conditional Tags Archive and was wondering if it's possible to show a widget depending on different posts / pages a visitor has previously viewed. For example, if I had a car ...
0
votes
0answers
15 views

Add fields to the top of widgets form

i have read this and create custom fields : How to add Custom Fields to Settings in Widget Options for all Registered Widgets? but i want to add this custom fields to the top of all other fields . (...
0
votes
0answers
12 views

How do I edit WordPress widgets?

I want to add title and alt attributes to links in the WordPress tag cloud widget but I don't know what to do. Can someone help with this? I've looked at the /wp-includes/widgets/class-wp-widget-tag-...
0
votes
0answers
17 views

Showing siteorigin widget on category page view

I am using the plugin Page Builder by SiteOrigin and I am modifying my category page to render a snippet of one of my custom widgets inside the single view. How would i render just a specific widget ...
0
votes
0answers
17 views

Siderbar implementation with collapsible bootstrap cards

I'm trying to implement collapsible Bootstrap 4 cards on sidebar widgets, until now I have this: register_sidebar( array( 'name' => esc_html__( 'New Sidebar', 'ns' ), ...
0
votes
1answer
25 views

Loop through Widgets in sidebar using widget array number?

Loop through widgets in sidebar This function from @birgire is almost perfect for me, but how do I call it using the sidebar array as the second parameter, rather than the widget ID. In his example, ...
0
votes
1answer
34 views

How to display products in sidebar in 2 columns?

I would like to put products view to sidebar on each blog page. However, it prints 3 columns by default which does not really look nice: I tried these approaches: 1) Editing functions.php of my ...
0
votes
1answer
21 views

How to create a wordpress widget that dynamically changes according to the page

I am creating a plugin in which my custom sidebar widget changes content depending on the page it is loading on. One way to do this is // Register and load the widget function custom_register_widget()...
0
votes
0answers
12 views

Input Options for users in widgets section

I am learning to create a widget in a WordPress. I learnt how to create inputs in which user will enter data using dashboard and how to show the data on the front end. But I got stuck when I thought ...
-1
votes
2answers
39 views

Can't use is_home in template-functions.php

I'm trying to load a slider in my header, but only on the homepage. I'm using The Ultralight template if that helps. I'm trying to (in template-functions.php) do the following: <?php if ( ...
0
votes
0answers
17 views

How to generate a widget form from an array with accordions/groups and save each value to array?

I created simple php class to generate fields in the widget form from an array. I don't know how to generate fields in the sections/groups and save it. Any advice and suggestions will be greatly ...
0
votes
1answer
16 views

Priority call methods - PHPMailer->addAddress(NULL)

I am currently making a WP widget and I am stuck with this. I want to pass a variable $emailReceiver from my form() method to my deliver_mail() method. The problem is that my deliver_mail() method ...
0
votes
0answers
10 views

how to use a sidebar widget with its options in a template

I know that the title of this question is a litle confusing, but this the problem I have recently installed a widget called Youtube Channel Gallery, which displays the latest videos on my website. ...
0
votes
1answer
20 views

Add a class to a dynamic sidebar's wrapper

I am making a plugin to display featured pages of a site, but it depends on a flex container and i cannot assure that a user's sidebar is going to have a display of flex. However, looking for ...
-1
votes
0answers
22 views

Add Row to Footer to display more widgets

I want to display the widgets I have created on function.php file in WordPress. This is my footer.php file code believe the problem is here </div> <!-- Page content::END --> <?php ...
1
vote
1answer
15 views

How to check if you are on widget.php page?

I am trying to write a widget and I need to add the color picker to my widget form. I want to add the script only on widget.php page and not on all the admin pages. Is there a way that I can detect ...
1
vote
0answers
17 views

WP - Genesis - How to get the content of a widget in php? [closed]

Provided I have a widget area that I register in genesis like this: genesis_register_sidebar( array( 'id' => 'my_header', 'name' => __( 'Image Header', 'my_header' ), '...
0
votes
1answer
18 views

I need to edit a widget, with no dashboard access

What the title says. There's a widget on a website that I need to edit, but I only have ftp access. I've tried everything to try and locate where the template is for the specific widget I'm trying to ...
0
votes
0answers
14 views

Combining Widgets

I'm building a woocommerce page for a client, which obviously features event/product creation. now i want to clean the admin dashboard up for him, so that it looks and feels the way he is comfortable ...
0
votes
0answers
13 views

How to randomized order of widgets inside the page content area of the homepage?

I have a wp plugin installed called siteorigin page builder, which has a layout builder where i can add a bunch of widgets inside the content area of my page. How can I make it that every time my ...
3
votes
1answer
62 views

How to avoid widgets added to sidebar on theme activation?

I am registering 3 sidebars on widgets_init register_sidebar(array( 'name' => esc_html__('Left Sidebar','creatus'), 'id' => 'left', 'before_widget' => '<div ...
2
votes
3answers
118 views

Defer Code in Widgets - Page Speed

How to UP Page Speed With Widget Defer? Is there a way to defer a widget in the footer? I have an external API in a footer widget which is slowing down my page. It is not needed until the page is ...
0
votes
2answers
34 views

Displaying a WordPress widget by name

I've registered a widget register_widget('Education_Work'); Now can I call a widget by registered name? Is it possible ? dynamic_sidebar('home-1'); // don't need this I want something like ...
0
votes
0answers
6 views

Where to find the widgets at the bottom of my homepage?

I had initially installed a subscribe plugin. There are two widgets at the bottom of my page as in the image. I want to remove subscribe from the bottom. If I go to the widgets section in my ...
0
votes
0answers
17 views

Widget PHP code isn't working

So I have a custom post type, and a php code widget that is connect to said post type and updates every time there is a new post in that type, but it's supposed to redirect when the display on the ...
0
votes
0answers
11 views

Where to manage the settings for a custom plug-in widget?

I successfully followed the instructions at https://kinsta.com/blog/create-wordpress-widget/ and got my custom widget to show-up in the list of plug-ins in a local instance of Wordpress, and was even ...
2
votes
3answers
35 views

Show Specific Footer Widget for Specific Pages

I registered a new footer widget with this code. register_sidebar(array( 'name' => esc_html__( 'Footer Sidebarprestige', 'realtor' ), 'id' => 'footer-sidebarprestige', 'description' => ...
1
vote
0answers
17 views

How to remove traces from widget during uninstallation

I have a small plugin, which registers a custom widget and now I am wondering how to remove all traces of this widget when the plugin is removed through the administration. If I look in the database ...
0
votes
0answers
23 views

How do I keep children of certain parent menus expanded by default on a sidebar?

We are using advanced sidebar pages menu: https://wordpress.org/plugins/advanced-sidebar-menu/ to expand / collapse children menus on a sidebar. By default, the parent sidebar menu is expanded, ...
0
votes
1answer
217 views

Change The Woocommerce Product Categories Dropdown Widget Placeholder Text

I've searched everywhere on the internet and tried to code it myself I want to change the default "Select A Category" placeholder text to "Select A Sub Category" so far I have tried this but it's not ...
0
votes
1answer
45 views

Read file contents the WP way

I'm developing a sidebar widget. I need to read a txt file in a particular directory of the website. I can do it with file_get_contents or readfile PHP functions, but what's the best way to safely do ...
0
votes
2answers
33 views

My theme didn't appear sidebar area

I tried to customize my WordPress theme but it shows this error. Your theme has 2 widget areas, but this particular page doesn’t display them. You can navigate to other pages on your site while ...
0
votes
2answers
37 views

Adding pagination to my theme [closed]

I would like to add a pagination to my wordpress theme. However, for me it is not so easy because my theme is built from the plugin "AT Posts Column", which displays the latest posts on the main page. ...
0
votes
1answer
14 views

Search transients through widget

I have a certain amount of data stored in a transient through a custom developed plugin ( just for this one website ). The transient contains one big array of data that I get from an external API. The ...
0
votes
0answers
35 views

how to add load more or pagination to recent post widget

i use "recent posts Widget With Thumbnails" plugin. this plugin not have any pagination or load more. please someon tell step by step what can do to add load more to this plugin. thanks