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

learn more… | top users | synonyms (2)

1
vote
1answer
26 views

How can i use the same template file with a widget and category loop?

i wrote a widget and i want to use category template which is located in "themename"/template-parts/content.php". <?php // Category.php while ( have_posts() ) : the_post(); get_template_part( ...
0
votes
1answer
8 views

How do I create a 'selection' criteria list' that will then dictate which posts are generated when the user presses search?

I'm very new to WordPress so please bear with me! I'm currently in the process of building a site for work. Our 'vision' is that we have three lists of options. People would select one option from ...
-1
votes
1answer
24 views

How do you submit a widget for the wordpress directory?

Looking for this process but for Wordpress: https://developers.google.com/blogger/docs/gadgets/gadgets_for_blogger#testing-style-fonts-and-colors Thanks.
1
vote
2answers
24 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. ...
0
votes
1answer
19 views

How to append custom text to the output of 'categories widget'?

How do I customize the "categories widget" to append additional text on the sidebar display? from category 1 category 2 category 3 category 4 to category 1 folder category 2 folder category 3 ...
2
votes
1answer
28 views

How to exclude certain widget from showing up on home/front page? [duplicate]

Without using a plugin, how do I prevent/exclude the sidebar widget "recent posts" from showing up on the home/front page? I do want it to show on the sidebar of rest of other archive/post pages.
0
votes
1answer
29 views

Widget text color change

hello i have this site and in the footer section there is the recent posts widget with the grey colored text. I wish to change it to white, i tried adding some custom css code in the theme child with ...
0
votes
1answer
17 views

wrapper div for widgets not showing with all widgets

I have registered a Widget area with the following code: // Register Sidebars function custom_sidebars() { $args = array( 'id' => 'footer_sidebar', 'class' ...
-1
votes
0answers
19 views

I have created custom image widget but image is not showing in the sidebar of my theme [on hold]

Here is my code, add_action( 'widgets_init', create_function( '', 'register_widget("pu_media_upload_widget");' ) ); class pu_media_upload_widget extends WP_Widget { /** ...
-1
votes
1answer
24 views

Woosidebars adding full page navigation on bottom

So, when i add an woosidebar to my woocommerce pages, only with the woocommerce product category widget, it shows it correctly on my right sidebar just like i wanted, but it also adds a search box and ...
0
votes
0answers
35 views

How to include JavaScript script only on specific page [duplicate]

I am creating my own widget. I need to use custom css and js files. I have used wp_register_style`wp_enqueue_styleandwp_register_script\wp_enqueue_script` functions in order to register custom styles ...
0
votes
0answers
18 views

WP 4.4+ Responsive Image Markup in Text Widget?

I'm slowly wrapping my head around the new responsive images features in WP 4.4. I've got it fairly well figured out now for our CPTs & default page/post content images. But is there a way to ...
0
votes
1answer
29 views

Adding classes to dynamic sidebar

Hey so I am trying to create this conditional that auto creates a grid layout when widgets/sidebars are added and removed. The goal is let the user put in as many widgets as possible without worrying ...
0
votes
0answers
17 views

Widget save brake jQuery [duplicate]

I have created a plugin that creates a widget. On the widget form i am using jquery functions that i load using wp_enqueue_script. When adding the widget on a sidebar, everything works. Then when i ...
0
votes
1answer
15 views

Wordpress add css class to cloud tag anchor tag

How to add CSS Class to ul and anchor element of Tag Cloud generated through wp_tag_cloud function. I want wordpress default class for ul 'wp-tag-cloud' to be 'tag-cloud' and anchor tag would have '' ...
0
votes
0answers
18 views

How to remove extra space from li of wordpress widget?

I am building a some WordPress widgets. During this I am facing some problems. When I am using <ul> <li> then my layout taking some margin or padding, but when I am using <td> or ...
1
vote
1answer
26 views

How can I apply css styling to the current day in the calendar widget

How can I apply css styling to the current day in the calendar widget? It seems there is no css class for the current day.
-4
votes
1answer
45 views

Widget won't work due to old JavaScript? Any ideas how to make it work? [closed]

I was trying to add this widget to my blog <!--BEGIN PROFILE WIDGET--> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js" ...
0
votes
2answers
40 views

display widget checkbox selection on frontend

I create a widget for a custom post type that will display a list of post in the widget area. it works fine, i can select multiple posts and save the widget but i can not get it to display on the ...
3
votes
1answer
80 views

How to get the registered sidebar's name by its id?

Let's say I have this code in my "functions.php": function mytheme_widgets_init() { register_sidebar( array( 'name' => esc_html__( 'Sidebar Name', 'mytheme' ), 'id' ...
0
votes
1answer
20 views

Widget settings disappear after refreshing page

I am developing a plugin that displays your average Google My Business rating in a widget. Everything works fine, except when I close the widgets page and return to it later (or do a plain refresh) I ...
0
votes
0answers
10 views

Widget not notifying customizer of changed value when updated via Javascript

I'm developing a wordpress theme that relies heavily on widgets for flexibility. I'd like to use the wp media javascript library to add images to some of these widgets instead of just having a text ...
0
votes
0answers
10 views

Can't display tag cloud by widget

I want to display tag cloud products and to use the widget of woocommerce - Tags products. Tags isn't displayed even though they are added to the 90% of the products. Tested on other sites and work ...
4
votes
1answer
80 views

Updating to Version 4.5 bumped my “main sidebar” widget out of place

I updated to the newest version of word press and it changed my home screen. Essentially it shifted my text to the right and as a result shifted my "main sidebar" widget downward to now begin below ...
1
vote
0answers
19 views

How to use a dropdown to populate a list of post from CPT

I've created a widget that displays the latest posts from a dropdown of all the blog post types. I want to add an option for the user to choose a single post to be displayed as featured. I would like ...
1
vote
1answer
48 views

I can't get my custom widget area to show on my Wordpress site

I can't get my sidebar to appear on my site. I add a widget section since there wasn't any: function.php <?php if (function_exists('register_sidebar')) // Area 1 register_sidebar( array ( ...
0
votes
0answers
25 views

Custom file with special code of category widget

Is any way to define custom code/file of standard class-wp-widget-categories.php for my theme? In standard WP class-wp-widget-categories.php list is printed in simple <ul> tag. I need to add ...
1
vote
2answers
17 views

Create a widget to use shortcode?

I have a plugin (Social Warfare) that I love. But, there's no widget available. What is involved in creating a widget so that I can use the shortcode that seems to work fine on the pages and posts?
0
votes
1answer
35 views

How can I delete a wordpress widget instance?

I am working on a WordPress plugin to insert advertisements.Its also having a widget to show the ads.In my main plugin class I want to check for a condition and if it satisfies I want to delete a ...
0
votes
1answer
25 views

Conditionally Load a Script if a Certain Widget is Shown on a Page

I know this question has been asked in the past but the accepted answer is incorrect. is_active_widget returns true if the widget is registered on the site. I.e., it was dragged to the right in ...
1
vote
1answer
54 views

How to add #navbar to all page links?

I have several Wordpress websites with large images at their tops, using 2013 child theme. How to add #navbar anchor to all page links, so that the browser scrolls down a bit, when a user clicks a ...
1
vote
1answer
22 views

widget should display post archive by year and on click also by month

I want to display the post archives like seen in this picture. Shown by year and on click it should open up the months. I am not sure how to approach this, would you customize the standard WordPress ...
0
votes
1answer
27 views

Enabled checkbox by default in WordPress widgets

The code works as expected. The issue happens if I set 'show_post_count' => 1 by default. In this case checkbox will be enabled always. How should I update the code to work as expected even if ...
0
votes
1answer
49 views

Creating widget - ask for selecting a post in the admin panel

First of all, sorry for my English, I'll try to make it understandable. I'm new on WordPress; I already have created a few plugins but they didn't needed admin configuration. Now I'd like to make an ...
0
votes
0answers
20 views

Advanced Custom Field in dashboard

I'm looking for a way to add a dashboard widget that has a ACF text and image field in it. I want a client to be able to quickly update a text field right from the dashboard. Any ideas on how to ...
0
votes
0answers
15 views

Edit recent post widget

Is possible to add featured image from post to widget area too, for only 1st post, if yes please advise Like this site: http://postimg.org/image/etwxba4nz/ I have asked the theme author, he's answer ...
0
votes
1answer
25 views

How to check widget-cpt meta and display its custom css in the head?

When dealing with a widget that is a custom post type, is there a way to detect when that widget is displayed, then check its post meta for any custom css and enqueue it in the head of the site? ...
0
votes
0answers
15 views

Handling dozens of sidebars

We have the job to realize a page with custom sidebars. Sidebars can be created on the fly on post an page edit screens, to add a custom sidebar on each page. The client wants to use this to add ...
0
votes
2answers
20 views

Use customizer or sidebar for header settings?

I'm converting html into Wordpress theme. In the header I have a tel number and a button. Both are links, but styled differently. Do you think it would be better to make them a sidebar (widget area) ...
0
votes
1answer
27 views

Repeated Output in Widget

I'm encountering an odd issue with a simple custom widget that I made to show contact info in a widget. For some reason when I add a phone number it's repeated multiple times as you can see here: ...
0
votes
0answers
18 views

In need of help with a “Notes” section

I am in the process of developing an educational website where each post is a topic of information or a "Module". I would like to give our students the ability to write down quick notes and items to ...
1
vote
1answer
66 views

Remove rss widget title link

I'm looking to remove the link and icon from rss feed widget. Is there a way it can be done? Obviously I don't want to modify the core files. So desired output is: <h3 class="widget-title">RSS ...
3
votes
1answer
40 views

Ban certain widgets from certain sidebars

I have several sidebars in the theme I'm developing. Some of them are designed to hold only a few widget types. So I'm trying to figure out how to keep other widgets out without using a plugin. After ...
0
votes
1answer
92 views

Change Woocommerce Product Categories Widget 'Title' based on Product Category

I'm looking for a way to change the widget title of Woocommerce Product Categories Widget based on the category I'm viewing. Category 1 -----> Display Title of Widget for Category 1 - Sub ...
0
votes
1answer
20 views

Is there a way to use get_sidebar() when no widgets are activated?

WP version 4.4.2, I have a customized sidebar.php and no widgets activated, which automatically prohibits get_sidebar() function to load contents of sidebar.php. Is there a way to forcefully load ...
3
votes
1answer
113 views

Display all posts with same title

I'm trying to display in a sidebar php widget, all posts with same post_title in a specific category. I find this code on internet but don't how to use it Thanks for your help. function ...
0
votes
0answers
30 views

Refresh the Customizers preview after editing fields

I'm using ACF fields on a few custom widgets. While using the Customizer to edit fields, they will save on change but the preview will not refresh. Calling wp.customize.previewer.refresh() will ...
0
votes
1answer
53 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
1answer
25 views

Check if widget has content

I just need to check, if sidebar has any content My functions.phpcode is below. function aspirationas_extra_widget_1_init() { register_sidebar(array( 'name' => __('Extra Widget 1', ...
-4
votes
1answer
44 views

Slider widget not displaying the caption for images

Here is my code for the slider.The place for a caption will appear blank above the image. <div class="slide-caption"> <div class="slide-data"> <a href="<?php // ...