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

learn more… | top users | synonyms (1)

0
votes
0answers
8 views

Add Field to filter posts by category in widget

So i have a plugin with a widget that displays the top voted posts. And i want to add a option to the widget, where i can choose the post category to display. Here is the script for that widget: ...
1
vote
1answer
472 views

Adding WordPress colorpicker in widget settings

I want to add the WordPress default colorpicker in widget settings form. Here's what I'm trying: In my functions.php, I have this: function widgets_scripts( $hook ) { if ( 'widgets.php' != $hook ...
0
votes
0answers
15 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
1answer
62 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
2answers
20 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 ...
0
votes
2answers
409 views

Unable to load “wpColorPicker” on theme customize page

Whether I'm using a Wordpress default theme or a custom one, I see the JS error: Uncaught TypeError: Object [object Object] has no method 'wpColorPicker' when I click "Customize" on the theme. I've ...
3
votes
0answers
36 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
21 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
17 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?
1
vote
2answers
40 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 ...
23
votes
4answers
6k views

Programmatically add widgets to sidebars

I would like to programmatically add widgets to my two sidebars that I've got. I couldn't find any official way of doing it? I started looking in the database. I've found that it's the ...
1
vote
1answer
327 views

Using add_filter() in Widgets

Just have a query reference the add_filter() function. Can you use this function inside a WordPress widget class. Example I have a widget with dynamic created code that I want to pass to another ...
-1
votes
0answers
10 views

Dynamic widget area creation from repeater option value [closed]

This is how I am getting repeater value foreach($angon['multi-text'] as $value) { echo '"'.$value.'",'; } Now I want to register sidebar with this values.The method to do so ...
3
votes
1answer
75 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
272 views

Right way to update widget on dynamic new input field

I have code to add an input field dynamicly in my theme. I have testd it, as a metabox and it works. But, not in a widget. First add and update, that codes work, but when I refresh page or try to ...
0
votes
1answer
855 views

How to have Multiple Archives Widgets, one archive widget per category (in a different page)?

Please read the whole question before assuming this question is repeated. After one day of trying plugins and tutorials, I am convinced that there is no straightforward method of achieving what I am ...
0
votes
0answers
15 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
1answer
15 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
12 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, ...
4
votes
3answers
2k views

Get page IDs based on which template they are using?

I have a situation where I need to provide a dropdown of pages in a widget, based on whether they are using a specific template. In other words, for all pages using template 'Foo', get the post ID. ...
0
votes
1answer
240 views

Calling widget using shortcode

I am using shortcode to call a widget. All is working fine but I want to pass some $instance(parameters) to the_widget. I am using $content to pass paramets to the_widget but I dont see any chnages ...
5
votes
1answer
10k views

Translate widget titles using qTranslate plugin

I'm actually using the qTranslate plugin to translate my website. It works really well with everything except one thing. the titles of my sidebar widgets. Actually, to translate some words we need to ...
0
votes
2answers
2k views

Creating a custom menu/widget area

I'm looking to create a /menu/widget area like the following site: http://www.microsoft.com/en-gb/default.aspx please see sections under downloads, security, support, about is this considered a ...
0
votes
2answers
43 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 ...
0
votes
0answers
27 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 ...
3
votes
1answer
177 views

Register multiple sidebars

I am registering my sidebars as follows: $sidebars = array ( 'sidebar-10' => 'Main Sidebar', 'sidebar-11' => 'Homepage Area One', 'sidebar-12' ...
0
votes
1answer
240 views

How Do I include/Import a Custom Widget from the Parent theme into My Child Theme?

I'm trying to make a small modification to a custom widget that was included with a clients parent theme. Whenever I remove the parents version of the widget (for testing purposes) the child version ...
0
votes
1answer
16 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, ...
1
vote
1answer
894 views

Latest/Recent posts widget title link

I have been struggling with this for a few hours now... I want to add a link to my recent posts widget title. I have tried a number of options given in forums but nothing seems to work. Tried ...
3
votes
2answers
553 views

Full width layout for custom post type pages

I'm trying to remove a widget area called 'Primary' from a certain page on a site. This is the function where I manage the sidebars: //ADD CATEGORIES IN SIDEBAR OF SINGLE POST TYPE add_action( ...
1
vote
1answer
520 views

How to “pair” two widgets side by side in one sidebar

Currently I use the Pinboard theme with 2 sidebars. In each sidebar I place one kind of widget several times. The point is that 2 widgets of a row (1 of each sidebar) belong together regarding the ...
0
votes
1answer
30 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
28 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
10 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, ...
1
vote
2answers
285 views

Elegantly using JavaScript on widget admin forms

I'm working on a project involving a lot of widgets, and I'm thinking it'd be really great to have a "More options" section built using jQuery UI Accordion that expands when clicked. So, I've ...
0
votes
1answer
35 views

latest posts-widget displays all posts on archive page but works great anywhere else

I noticed the latest posts widget in my footer displaying all posts. Anywhere else on my page, it displays only the amount of posts it should. I am using a custom theme and this is my archive.php: ...
0
votes
1answer
24 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 ...
-1
votes
0answers
27 views

Displaying a twitter widget on my page

I'm a student, tasked with creating content for my college's GIS program website and I am having two little problems with a twitter widget. Here is my website. The first and more minor problem is ...
5
votes
3answers
133 views

Prevent second widget activation

Is there a way to "remove the widget from available widgets" after you've activated it once on some area? The idea is to allow user to activate only one instance of it.
0
votes
1answer
70 views

How to echo Widget Title in Custom Frontend-Template Box

I've created a custom Widget with the help of following code: // Creating the widget class wpb_widget extends WP_Widget { function __construct() { parent::__construct( // Base ID of ...
1
vote
2answers
287 views

Add description to custom text widget and display the 5 recent post titles

I just started coding and working as an intern for a company. My boss asked me to create a custom text widget for practice in making word press widgets. The problem I am running into is I have no idea ...
0
votes
1answer
19 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
10 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

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
15 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
1answer
24 views

Widget & storing a Select box choice

I am creating a simple widget which displays all of the pages on the website. The trouble I am having is how to store the user's choice and display it on the front end. At the moment, when saving my ...
0
votes
1answer
334 views

Multiple entries in get_option results? or why is _multiwidget set to 1?

I am developing a wordpress widget, and need to store some user configuration values, that is why I am using wordpress update_option and get_option. I am new to widget development. I have some ...
0
votes
1answer
38 views

Make single widget area top level in 4.0 Customize Panel

So I have a widget area that, in v4.0, is burried in a dropdown within the secondary Widgets panel on the Customize panel page. Because it's the only widget area it feels rather silly being burried ...
0
votes
1answer
45 views

Display Posts by Views (Popular Posts Widget)

I am trying to display the most popular posts based off of this, but I don't think it is working properly. When you view a post it seems to add 1 view to each of them, not just the unique ID. ...
0
votes
2answers
52 views

Twenty Twelve Widget Taking Space

I am using the twenty twelve theme and in this theme I used the Main Sidebar for widgets. I used the code below to make the widgets disappear in my homepage ( front page ). The code works however, the ...