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

learn more… | top users | synonyms (1)

0
votes
1answer
15 views

Shortcode in Text Widget not working

Not sure why this is not working. I get no errors, but just shows nothing at all in the text widget. The shortcode works on pages and posts. WordPress version 3.9.1 add_filter('widget_text', ...
0
votes
1answer
20 views

Can't output the number 0 in widget

I have an input box where a user can input a number and then that number will be outputted into an html page. It all works fine except when you enter in the number 0 it doesn't output anything but it ...
0
votes
2answers
15 views

Wordpress - registering sidebar and adding a button directly after .textwidget

I have registered a new widget area, code as below and want to add a button after the .textwidget, however cannot seem to do it properly. Adding it after the </li> results in the button not ...
1
vote
1answer
27 views

How to check if a widget has no title

I wanted so that my widget has the following structure: <div class="widget-area"> <h4 class="widget-title">Foo Bar</h4> <div class="widget-content">Blablablabla ...
0
votes
0answers
9 views

How to give dynamic url path in widget?

I have a widget and give link to some text within it like href="http://www.netattingo.com/dev/imc/" as it is static path in widget but when I try to to use "site_url" or "bloginfo". It does not work. ...
0
votes
0answers
20 views

Widget Areas Still Appearing in WP ADMIN When They Shouldn't

I had a bunch of "Widget Areas" registered for my theme. I removed a few and added a few. The ones which I removed, I deleted the code which is hooked on widgets_init for registering the sidebars. I ...
-4
votes
0answers
21 views

How can I add a jquery to my website [on hold]

How can I add a jquery widget to my website so my website will show a link I need to add? Thank you Richard
1
vote
1answer
28 views

I wrote my plugin. How to display the result of the plugin's function to sidebar (widget?)?

I wrote my plugin. How to display the result of the plugin's function to sidebar (widget?)? <? function register_form () { global $post; $test = "testesttest"; var_dump("testtest"); ...
-1
votes
0answers
13 views

How to make custom menu widget to have dropdwon function?

How to make custom menu widget to have dropdown function? I am to avoid put into sidebar, because I had long product category list and I would like to put custom menu widget (with dropdown) before ...
0
votes
2answers
16 views

Unregistering a Sidebar in Child Theme

I'm working with a handy responsive theme framework (Reverie) and I'm developing my own theme the right way using a Child theme. The Parent theme calls a sidebar called with an ID of 'Footer' and ...
0
votes
1answer
19 views

Widget dropdown always displays first option

I have a custom widget that I have made but whenever I change the dropdown value it always reverts to the first option when I save the widget. How can I have it display whatever option the user ...
0
votes
0answers
57 views

Dynamic css for a widget plugin

I have a plugin that creates a widget to show latest posts and I would like to add a dynamic css file to style the post title without using inline styles. So for example i have public function ...
0
votes
1answer
21 views

New Widget are not showing

I added a new sidebar according to WordPress Codex and for some reason it shows only on the admin and nothing shows on my front pages.. I tried to look for it on Google and here on the forums but I ...
0
votes
0answers
17 views

Wanted to collapse all the widgets in sidebar by default via jQuery

I already applied jQuery on footer to Slide them up but i noticed that when the page is completely loaded the widget slides up properly but dont know how this again slides down automatically. I m not ...
2
votes
1answer
51 views

Programmatically edit the text of a widget

I have text widgets that contain text. I'd like to programmatically edit that text. Is there a way to do that?
0
votes
1answer
31 views

Wordpress Footer Widget Processing

I made a sidebar in wordpress and have widgets in it, I want to process them one by one so that I can set their locations in theme according to me. Example: If I have a 3 widget in my footer ...
0
votes
1answer
17 views

Dynamic Width of Widgets

Ok, I'm using the following code for up to 6 widgets in a sidebar function s57d_sidebar1_params($params) { $sidebar_id = $params[0]['id']; if ( $sidebar_id == 'sidebar-1' ) { $total_widgets = ...
0
votes
0answers
11 views

Prevent submission of widget form

How can I prevent submission of a widget form? The following doesn't work for me. And preventing submit won't work because Wordpress uses Ajax for those forms. jQuery(document).ready(function($) { ...
0
votes
1answer
32 views

WP_query returns error when used for custom widget

I was working on creating my first plugin/widget that should display a really simple loop containing only a custom field (image) I've been testing the loop without any problems in my theme but when I ...
0
votes
0answers
15 views

Display custom menu on specific post/page

I have a real problem with Wordpress. My need is this: I have three main pages that every one must display a list of sub-pages (custom menu) and a list of events related to that specific page. Both ...
0
votes
0answers
32 views

Hide widget on page

How can I hide a widget from a certain page (one page). After spending an hour, all I can find is with the plugins. The problem is, that I know with them how to do it, but one widget (ad widget) is ...
0
votes
1answer
14 views

Get Widget Instance inside Widget

I'm trying to access the $instance variable from a custom function I've written inside my Widget, but I keep getting a "variable is undefined" error. How can I re-create the $instance variable? ...
0
votes
0answers
26 views

Infinite scroll on sidebar widget

I am trying to add an infinite scroll functionality to a website i am building, but i want to add it to a sidebar widget. I have a widget that shows a list of recent posts, and i would like to add an ...
0
votes
1answer
17 views

How to filter the widgets like calendar and archives based on category in WordPress

Thanks for the reply now the news page and blog page of my website has sidebars to specific to those, but now the new problem raised on the widgets side. Specifically Calendar and Archive widget are ...
0
votes
0answers
7 views

Jetpack infinite scroll on widget

I would like to add the jetpack infinite scroll (other options would be good as well), to a sidebar widget that shows "additional posts". So instead of paginating (ajax) the whole page, i only want to ...
0
votes
1answer
24 views

Changes in widget customizer not triggering 'save and publish'

I'm making some of our widgets customiser friendly, so they work on the customise page and support widget previews. Usually when you update a widget the save button becomes usable and changes to 'save ...
0
votes
0answers
12 views

How to include WP_Widget from another file in main plugin file?

I tried to use the code bellow in my main file: define( 'MYPLUGINNAME_PATH', plugin_dir_path(__FILE__) ); include MYPLUGINNAME_PATH . 'class/class-widget.php'; Then I have a file ...
0
votes
1answer
18 views

adding image in the header of my dev widget

i want to add an image to the header of my widget in a div tag like so: <div class="header" align="center"> <a href="http://www.link.com"><img name="Header" ...
0
votes
1answer
42 views

Theme's default styles are overriding my plugin's custom CSS

I have created a little plugin that creates a widget that I've made, basically just a pretty <ul> element. Unfortunately, all default widget styles are overriding my custom CSS, and adding ...
0
votes
0answers
29 views

Custom widget not appearing on front end

I have the following widget location defined in my theme's functions.php: register_sidebar( array( 'name' => __( 'Opening Hours', 'transparent' ), 'id' => 'sidebar-hours', ...
0
votes
1answer
33 views

Using AJAX in WordPress Widget

The past few days I've been Googling and searching for answers to no avail. I'm building out a "Featured Content" widget where the user can easily (via ajax/jquery) search for posts. Is it possible ...
0
votes
0answers
57 views

Custom Meta Boxes repeatable field show on single.php

I have some code that adds a Metabox, with repeatable fields to the edit screen of the WordPress backend. It looks like this: The code, I have in the functions.php, looks like this: function ...
0
votes
1answer
26 views

Custom CSS for a particular text/html widget in Wordpress

I have a couple of text widgets on my Home Sidebar. There is one text widget in particular that I want it to implement custom CSS written in my child theme rather than the default styling provided by ...
0
votes
1answer
15 views

$before/after_widget/title not displaying anything

I have built a custom widget with this code: class rfw_dock extends WP_Widget { function __construct() { parent::__construct('rfw_dock', __('TITLE'), array( 'description' => __( ...
2
votes
1answer
34 views

Randomize widgets displayed in my sidebar [duplicate]

I have a sidebar which might have any number of widgets. I can count the number of widgets that exist in the sidebar. How do I display randomly only one of the widgets in my sidebar at each page load? ...
0
votes
1answer
42 views

Dynamically display font icons in widget

All, have a movie review site that I assign a score to. Currently I'm using a widget which works fine...but I changed all of my scores to a 5 star rating system (3.5/5, 5/5, etc.) so the widget that ...
0
votes
1answer
16 views

Instance not inserting data for widget

I am trying to create a widget for my website. This is my first instance of widget creation and I am really unsure as to what the issue is Here is my code as it stands: add_action( 'widgets_init', ...
0
votes
2answers
37 views

Change HTML structure for custom menu in sidebar

I've been digging for documentation on how to change HTML output for the "Custom menu" which you place in optional widget. So its clear what I meen I have attached an image of the widget block here: ...
-2
votes
1answer
23 views

how to move a widget from theme 1 to theme 2?

I bought two themes for two websites but now I can't buy the domain name and host for both and decided to run just one web I try my two theme 1-metro mag 2-Glider I decided to run Glider at least but ...
0
votes
2answers
23 views

register_sidebar fails when using a include within functions.php

I have registered several sidebars via functions.php like this: // Register sidebars function register_widgets() { // Main sidebar register_sidebar( array( 'name' => __( 'Main Sidebar', ...
1
vote
2answers
32 views

Hide default “Recent Comments” Widget if there are no comments yet

Is there a way to hide the widget completely if there are no comments yet? I was thinking about maybe adding a php function to my functions.php file - is that a possible way? If so, can someone ...
0
votes
1answer
14 views

widget exclude post by custom field

I have a widget that gets posts from different post_type's. I want to exclude some posts that have a custom field value e.g. I save a form where a checkbox adds a value of 0 or 1 depending if ticked. ...
0
votes
3answers
38 views

Allow different <span> tags in widget titles

How can I make widget titles allow HTML? I want to add icons from an iconfont to the titles like <span class="icon-someicon">Widget Title Here</span> I tried the following but it does ...
1
vote
1answer
22 views

Display sidebar only if it has content

I have registered a new sidebar. Here is my code in functions.php: register_sidebar(array( 'name'=>'1', 'before_widget' => '<div class="div1">', 'after_widget' => '</div>', ...
0
votes
1answer
56 views

Add Bootstrap Classes to Recent Posts Widget

I am building a site that is based on an existing theme, lawyers. I am tasked to make the recent posts widget look like the practice areas section, I would need to add some structural divs (bootstrap ...
0
votes
1answer
21 views

Confused about customising widgets

I am fairly new to wordpress but im having trouble working out how to customise the widgets. I have customised the search widget like so (in the functions.php file) function widget_search() { ...
0
votes
2answers
28 views

Remove image height/width attributes from Image Widget

The Image Widget includes width and height on the images which I've unsuccessfully have been trying to filter out so I can have fluid width. I've tried the following, which seems to be the most ...
0
votes
0answers
24 views

Wordpress API to get galleries?

Is there a way to get with wordress API the created galleries? The main idea would be to create galleries as normal wordpress pages or posts on and use those images in a wordpress widget.
0
votes
1answer
27 views

Wordpress widget in custom theme

I created a custom theme and writing a basic widget for my wordpress based website. If I paste the code in functions.php the code works fine, however if I paste the code in a separate file and keep it ...
0
votes
1answer
61 views

Widgets not displaying in theme customizer

I am developing a new theme and I am using several sidebars in this theme. All works fine, but the widgets are not showing up in the theme customizer section. All widgets are working fine under ...