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

learn more… | top users | synonyms (2)

2
votes
0answers
39 views

How to enable “shift-click to edit this widget” functionality on a custom widget?

I have created several custom widgets using the default widgets code as examples. The widgets all work fine, and I've been using them in production for awhile. I've been working with the new ...
2
votes
0answers
41 views

Why won't my custom widget stay in the sidebar after a reload?

After I drag my custom widget into a widget area and reload the page it's gone. Any ideas? <?php add_action('widgets_init','register_postTypeWidget'); function register_postTypeWidget(){ ...
1
vote
0answers
16 views

Widget area inside a widget

I tried putting dynamic_sidebar('widget-id') inside a custom widget I created and it worked. The only thing I can't figure out is how I can do this through a loop. Is there a way that when the widget ...
1
vote
0answers
15 views

WP_Widget instance value to wp_head

I have some problem with dynamic variable on widgets. class instaslidewidget extends WP_Widget { public function __construct() { parent::__construct( "text_widget", ...
1
vote
0answers
46 views

Widget options are not updated

I'm creating a plugin which creates a widget with some options. I've extended the WP_Widget class: class Dynamic_Player_Widget extends WP_Widget { function Dynamic_Player_Widget() { ...
1
vote
0answers
33 views

Widget on the right side of the page overlaps with the left side

I added the mailchimp widget to the right column of my blog. But for some reason, it overlaps with the main content of the blog. Here is a screenshot of what happens Would anyone know why this ...
1
vote
0answers
222 views

Edit and make class-wc-widget-featured-products.php update-proof

Within the class-wc-widget-featured-products.php file I need to Remove this on Line 101: <?php if ( $r->post->post_title ) echo get_the_title( $r->post->ID ); else echo ...
1
vote
0answers
126 views

How to update the widget form when the image is selected?

I have created a custom widget. There are 2 things that I can't do: I need to open the new media uploader window when the button "Select The Image" is clicked. When the image is selected from the ...
1
vote
0answers
61 views

Issue understanding and using WordPress filters and actions

I have a custom WordPress plugin that I have developed. The plugin is a widget bundle containing a bunch of custom widgets. The scenerio The plugin allows for custom css styles through creating a ...
1
vote
0answers
69 views

Custom taxonomy widget in admin area

I have a custom taxonomy set up on a custom post type and the box it uses is the same as categories, except I wanted to make it easily searchable using a filter script and then also allow the user to ...
1
vote
0answers
32 views

How to hook into unregistering a widget instance?

I would like to hook into a widget instance after it is removed from a sidebar panel on the Appearances -> Widgets admin page. So if the instance was an active widget and then removed, I would like ...
1
vote
0answers
107 views

Problem getting current post tags to show in a widget

I have tried tons of examples and suggestion on this topic but I can not get them to work. What I am trying to do is display the tags associated with the current post in a widget. I have built the ...
1
vote
0answers
174 views

Save Multiply Checkboxes in a Widget

Trying to save multiply checkboxes in a widget, but no luck. Here is my code: function update( $new_instance, $old_instance ) { $instance = $old_instance; $instance['title'] = ...
1
vote
0answers
73 views

Remove […] from RSS feed?

I would like to remove the [...] from the RSS feed widget. I have tried adding the following to functions: function replace_ellipsis($text) { $return = str_replace('[...]', '-', $text); return ...
0
votes
0answers
15 views

Embedded Videos (PB) - Not Available

I am using this link to create a wordpress website VIDEO At minute 53 the guy is using "Embedded Videos (PB)" widget in order to embedd a youtube video. (By the way he is using Page Builder). Problem ...
0
votes
0answers
13 views

“widget” on edit.php which loads/saves data

i am trying to add a "widget" to the edit.php post-filter-table as seen in this plugin: https://wordpress.org/plugins/advanced-post-manager/screenshots/ i would love to do this with piklist or ...
0
votes
0answers
14 views

Any reason why widgets/menus get emptied when I updated custom theme code?

Deployed my site over git last nite, and client came back saying some menus in the the footer widgets had disappeared. I looked in the admin, and the widgets were still available but all the items ...
0
votes
0answers
8 views

how to convert Html block to dynamic widget?

<div class="widget-wrapper"> <div class="widget-icon"> <i class="fa fa-facebook"></i> </div> <div class="widget-title"> </div> ...
0
votes
0answers
18 views

Widget Popular Posts

I want add "code 1" inside "code 2", but I don't know how I can do this. CODE 1 (found here): <ul class="popular_posts"> <?php $pc = new ...
0
votes
0answers
8 views

Widget Logic code for different PMP membership levels

I'm using both Paid Memberships Pro and Widget Logic plugins. In PMP, I set up 2 membership levels - one free ( id# = 3) , one paid (id# = 1) With Widget Logic, I'd like to have the custom sidebar ...
0
votes
0answers
9 views

Run function after theme is installed for the first time

I want to run a function to add default widgets for my theme when it's installed for the first time. I tried add_action( 'after_switch_theme', 'add_theme_widgets' ); but it resets the widgets back to ...
0
votes
0answers
24 views

php- What can be the best alternative to eval()?

I am using WordPress and for some reasons I need to execute php in my WordPress text widgets. I googled and found this code to add in functions.php file: add_filter('widget_text', 'php_text', 99); ...
0
votes
0answers
30 views

Add classes to individual sidebars

This is my first time posting on here so let me know if I don't follow any rules or best practices. I'm creating several sidebars through our WordPress site and not all of them will be styled the ...
0
votes
0answers
37 views

How to change the widget's instance settings depending on sidebar

I want my widget to have one default option value in sidebar-1 and another in sidebar-2. How can I do it? I know wp saves widget right after drag and drop it into different sidebar in widget admin ...
0
votes
0answers
26 views

How to Activate Ajax autocomplete in the “Right Now widget” in wp-admin?

in wordpress multisite we have "Right Now widget" where you can search for "users" and "sites". the question is how to enable the Ajax autocomplete for this fields? the input code is: <input ...
0
votes
0answers
47 views

Recent Posts Widget to display Custom Post types doesn't display content

I have created a few custom post types on my site (WP 4.0 / TwentyTen Child Theme) and I was hoping to create widgets to display them on the sidebar. The custom post types work well but the widget ...
0
votes
0answers
26 views

Target only widgets within specific sidebar

I am trying to target widgets within a sidebar by targeting the sidebar ID To explain, I am using the - https://wordpress.org/plugins/image-widget/ - plugin and utilising their custom template ...
0
votes
0answers
21 views

How do I add a New-Post widget to my primary sidebar?

I am trying to modify the twentyfourteen theme by simplifying and deleting most of its widgets. I have done this successfully for the toolbar, but one of the widgets I would like to keep is the one ...
0
votes
0answers
24 views

Hooking action once but called twice

class GridModSidebars{ public function init(){ add_action('widgets_init', array($this, 'registerSidebars'),20); } public function registerSidebars(){ $args = array( 'name' ...
0
votes
0answers
16 views

Allow end users to change settings of a widget

I currently have a customized widget installed. At this moment, I would like to allow end users, through the use of certain admin menu (other than appearance menu) to change the settings for this ...
0
votes
0answers
13 views

How to add more than one custom widget

I created a new widget using instructions found here and it worked OK. I needed to create another widget. I created it from the default Text Widget, placing the code in functions.php (as I did with ...
0
votes
0answers
27 views

Dynamically creating classes for Widget API

So let's say I want to make new Classes for the Widgets API using some variables that the user can configure. The only way I have figured it out is to use the eval() function. This is due to how ...
0
votes
0answers
20 views

Run widget code before post content

I have a customized widget that allows the user to create a quick post on the front page sidebar. The code processing appears to happen after the post content is rendering, meaning that after i submit ...
0
votes
0answers
39 views

Custom php Widget keeps disappearing from the front end

I've created a widget to show custom testimonials on the sidebar. It checks if the post has a custom field 'customer_review' then prints a it on the sidebar. Thing is, the testimonial keeps ...
0
votes
0answers
31 views

Widget area to full width layout only

I want to add a new widget area that will only display if the layout is full page (no sidebars). There doesn't seem to be a WordPress conditional based on layout. Is there a way to do this?
0
votes
0answers
23 views

Group multiple widgets in one

Is that possible to group some widget into one. I am creating some similar widgets and I want to group them altogether. Like I want to name it "Widget Group" and when I activate "Widget Group" plugin, ...
0
votes
0answers
29 views

“Add post form” inside a custom admin widget?

I have created a custom post type (support ticket) and a custom user role (client). So, I want to create a widget that allows a client to add a new ticket (which contains only 3 custom text fields). ...
0
votes
0answers
28 views

Populating a list of IDs for a widget to use in WordPress

I am trying to create a widget that takes a list of user-given IDs for items and then displays them at random wherever the Widget is placed. So far I have the following set up: User enters an ID in ...
0
votes
0answers
11 views

How to format the Widget Display function contents?

I'm writing my first plugin, and basically I'm wondering how to write the code which goes inside of the widget display function: function widget($args, $instance) {} I'm trying to run a post query, ...
0
votes
0answers
22 views

I'd like to move the Widgets Panel to the bottom of the list in Customizer

I'd prefer to have the 'new' Widgets Section/Panel (that extends to the widget areas) drop down to the bottom of list in Customizer. I've tried: $wp_customize->get_panel('widgets')->priority = ...
0
votes
0answers
19 views

Adding repeatable fields used in Widgets?

How can adding repeatable fields used in Widgets? I want add (Add more country favorites fields) and remove (Example ... France) what I actually Have what I want Any tips?
0
votes
0answers
36 views

Radio buttons in widgets

What I'm trying to do is to create 2 radio boxes in my widget admin panel and save the one that's checked in the widget instance. For that I've set the name and the id of the input like this : ...
0
votes
0answers
23 views

User editable blocks per page

I'm pretty sure this question has been asked a million times but I can't seem to find an answer. Imagine a page template with multiple sidebars. What I want the site admin to be able to do is create ...
0
votes
0answers
16 views

Can you create your own widgets and use them for editable areas of client content?

I'm relatively new to WordPress. As a content management system I chose WordPress so that I could design a website for a friend in a way that would be easy for them to use when I had handed it over. ...
0
votes
0answers
8 views

Server Side Includes not working in text widget

I'm trying to add Server Side Include code to a WordPress text widget, but the content is not being displayed. I've added SSI before on my non-WP site, but for some reason its not working with my WP ...
0
votes
0answers
21 views

Filter “widget_comments_args” won't work

I used "widget_comments_args" for changing comments query for Recent Comments, but it won't work. add_filter( 'widget_comments_args', 'my_function_name' ); function my_function_name( $comment_args ) ...
0
votes
0answers
79 views

Working widget does not show up in appearance->widgets

I try to add a custom widget for use outside of a normal sidebar. For that I have created class myfirst which extends WP_Widget and with appropriate function overrides. namespace widget; class ...
0
votes
0answers
36 views

How can I embed a .php file inside of a widget?

I have a currency exchange that I'm trying to put in the sidebar of my Wordpress site. The currency exchange is a simple php file that I'm trying to 'embed' as a widget. I created a simple plugin, ...
0
votes
0answers
15 views

Enqueue script in Widget

I am trying to use wp_enqueue_script inside function widget of the Widget class. But it seems like when I print html it doesn't handle the javascript functions which I enqueue before. This enqueue ...
0
votes
0answers
20 views

Widget form method does not work properly

I need your help. I have this code <?php class Messenger extends WP_Widget { function __construct() { $widget_ops = array('name' => 'Messenger', 'description' ...