Tagged Questions

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

learn more… | top users | synonyms (1)

-1
votes
0answers
3 views

Remove meta boxes registered by nextgen gallery plugin

i am using NextGen Gallery. Works fine, but i need custom edit this plugin. i need this: delete widgets on nextgen gallery dashboards. i tried this code, but it didn't work:-/ add_action( ...
1
vote
1answer
19 views

Custom Tag Cloud widget missing tags

I was trying to create a custom tag cloud widget that will look like this: Also, when I tried including some new tags in my post then it's showing something like this (just one tag): This is my ...
0
votes
2answers
32 views

Echo title with permalink

I was creating a wordpress sidebar widget that will display recent posts. For, this i've created a custom widget(popular_posts_widget.php) and included in my theme functions.php. I was trying to ...
0
votes
0answers
31 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
1answer
20 views

How to translate Widget Description in constructor?

I'm building a localized widget and the translation works everywhere but in the language string in the constructor. I have read that the whole plugin initialisation has to be bound to the init ...
1
vote
1answer
16 views

Wordpress: How to embed a widget on a separate website?

A client requested that we make a copy of their WordPress widgets onto a separate, non-WP site. Is there an easy way to "plug in" the widget? I imagine I would have to somehow source to something ...
0
votes
2answers
21 views

Tags Instead of Category

I have this widget that allows me to show the latest posts from a specific category in the sidebar. Here's the code; add_action( 'widgets_init', 'tie_categort_posts_widget' ); function ...
0
votes
0answers
18 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
19 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
1answer
22 views

Wordpress Javascript Widget jQuery Dependency Issue

I am using a local clean install of WP 4.0 en_GB with no plugins. I have been provided with some information to implement a JS widget into my website. <div id="login"></div> <script ...
0
votes
0answers
24 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
1answer
30 views

Modifying the default search widget

I'm creating a plugin widget that does a different search from the normal default search widget. I copied the code from the default widget: class new_search extends WP_Widget { ...
2
votes
0answers
20 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 ...
0
votes
0answers
15 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
1answer
36 views

Help with custom widget

I've tried methods of creating a custom widget and have had no luck. I am looking to 'widgetize" a template and allow an end-user to only update text in the widgetized areas. It seems like this is ...
0
votes
1answer
36 views

Do I have to widgetize my pages?

I have a three pages. On front page I want to show some custom test about page1,link to page1, custom text about page2, link to page2, custom text about page3, link to page3. And then I want a ...
0
votes
1answer
39 views

Displaying details of a post in a sidebar

I am developing a wordpress theme but m still new into and was learning. Basically, its a theme for resource website which provides web templates. In my theme i've created a details section in sidebar ...
0
votes
0answers
17 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
1answer
31 views

Static image for embedded YouTube video instead of blank player?

Thanks to this answer I have embedded a YouTube video in a Text Widget using [video src="http://youtu.be/JQ_2De2cnzI&rel=0&showinfo=0"] However it displays as this blank player when the ...
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 ...
-1
votes
0answers
14 views

How to change the stylesheet of a widget

I am trying to change the color of the text in a plugin (a widget). How do I find, unregister, dequeue a plugins/widgets stylesheet and add my own?
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 ...
1
vote
1answer
53 views

How do I embed in a text widget?

I'm trying to embed a YouTube video in a Text Widget and Wordpress 4.0 is stripping out the embed when rendering. For example, if I put this in the body of the widget: Before ...
3
votes
1answer
63 views

How to update widget from widget() function?

I'm trying to create a simple linkroll widget for displaying recent https://pinboard.in links via their API. To maximize loading speed, I want to cache the linklist in a widget field, as well as the ...
0
votes
1answer
51 views

display specific widget to a page

im trying to display a specific widget i need for the header current im using a code to display all widgets but my problem is that if I add additional widgets it will destroy my site. ...
0
votes
0answers
24 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
11 views

Show value based on dropdown [duplicate]

I am trying to create a short code with a form I have the form displaying ok but I need to be able to pull the price information from sql table as well and show it in a label. How can i do that using ...
0
votes
0answers
12 views

Widget not working with Data [duplicate]

I have tried the following code given to me by another question here but for some reason in my widget its just dispalying the word liters in the drop down its not puliing data when i look at the code ...
0
votes
2answers
33 views

How to get post ID of the current page/post inside a widget?

I'm trying hard to get the post ID of the current post/page inside a widget class but doesn't work, I know there's get_the_ID() and some other options but not a single works inside a widget. Here's my ...
0
votes
1answer
37 views

How can I retrieve data within my widget

I have a Widget which I am creating but my quesiton is how do I access my custom table which I created via my plugin. I am attempting to fill the dropdown from the table called tfp which contains the ...
0
votes
0answers
19 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 ...
-1
votes
2answers
34 views

How do I include the sidebar (with Widgets) in a custom theme?

I have created a custom WordPress theme and need to be able to include the sidebar with widgets. I have the sidebar.php file, functions code and three widgets waiting to see the light of day. But ...
3
votes
1answer
67 views

Ask user permission when activating a plugin

Is there a specific Wordpress API way to ask the user's permission for something when activating a plugin? Due to the Wordpress plugin directory policy I have to ask the users consent for the ...
0
votes
0answers
32 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
23 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
1answer
92 views

Using a multiple <select> element in widget form

I am trying to save all of the options in a <select> element in a widget. So far I have the following PHP code for the form: public function form( $instance ) { // Code for editing/adding ...
0
votes
1answer
33 views

Why isn't my custom widget outputting any content?

I've been following numerous tutorials and codex pages in order to make my own widget in WP 4.0. It seems as though I'm very near; I can output something from the widget, just not any of the fields. ...
0
votes
0answers
21 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
23 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
2answers
56 views

Add content to footer - above wp_footer

I know there are several questions about the footer, but I did not find answer to this. If this has been asked before, my apologies. I am developing a widget plugin and I wanted to give users the ...
1
vote
2answers
44 views

Display assigned terms with link

I want to display product assigned terms, wrapped in link/anchor MarkUp, in my sidebar on a page as a widget. I am not getting the correct tag URL. Code returns visited product URL instead of listed ...
0
votes
1answer
17 views

Get widget locations in WordPress plugin

I'm writing a plugin and i am searching for a function (preferably a WP function) that returns all sidebar id's that have my widget in them. For example : i placed my widget in sidebar1 and sidebar2, ...
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
1answer
46 views

Escape HTML on WP input

I am slightly stuck on creating a widget, it has an input (bit like the default text widget) but got an issue adding html into it. My code is: $instance['content'] = ( ! empty( ...
0
votes
1answer
48 views

How to add wp visual editor in a custom widget?

I am developing a widget plugin and want to add a textarea with WYSIWYG editor in widget settings. Any help would be highly appreciated. Thanks.
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
1answer
40 views

multiple custom post type category selection search

I hope it's clear from the title but let me try to explain it better. Looking at this image should make it clear: I have custom post type names Product and categories related to it. What I am ...
0
votes
1answer
21 views

How to Activate WordPress Widgets

I have created some widgets for my WordPress site. I use fallback data widget WordPress which I got form this free WordPress theme: https://wordpress.org/themes/brightpage. So, if I don't put any ...
0
votes
1answer
11 views

How to Make widget area on place of comment

I want to make a widget First I registered widget area in functions.php register_widget(array( 'name' => 'widget', 'description' => 'Sidebar below single post', 'before_widget' ...
0
votes
0answers
16 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 = ...