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

learn more… | top users | synonyms (2)

0
votes
0answers
8 views

Change widget: categories to tags

I have a theme with a widget that displays posts from a category. How can I change it to tags? This is the code: /** * Plugin Name: Middle Buzz Widget */ add_action( 'widgets_init', ...
3
votes
1answer
25 views

Adding widgets programatically: how to avoid collisions?

I am developing a theme, and I'm trying to add widgets programatically to its sidebar. I read this excellent answer: http://wordpress.stackexchange.com/a/51086/14225 But there's one thing I'm not ...
0
votes
1answer
17 views

Twenty Fourteen: how do they populate by default the sidebar?

My question is pretty similar to this one: How can I insert default widgets when my theme is activated (similar to what twenty eleven does)? Except that it's for Twenty Fourteen. I'm trying to use ...
-1
votes
1answer
15 views

How do I insert a photo at the top of the sidebar?

http://www.beautybykatlin.com/ Hello, How do I add an image at the top of the sidebar? I had one there but I deleted it and I don't know how to get it back. Please help!!! Thank you!
0
votes
1answer
17 views

Adding inline styles from a widget

I'm working on a theme that has an optional widget to allow users to put some site elements where they want. One of those is a list of social media icons. These are font icons, so they can be styled ...
0
votes
1answer
14 views

using get_template_part() inside a widget and passing variables

I read that get_template_part() should only used by themes not plugins, I don't know if using it inside a widget function (created by the theme) is considered as a plugin or not. Anyway, I'm trying ...
0
votes
1answer
14 views

Making jQuery .change() event persistent after widget save

I'm creating a custom widget that uses a select element with a bunch of options and a simple jQuery function to trigger the visibility for some <div>s below it based on the selection, through a ...
0
votes
0answers
8 views

MYSQL ignore categories on Wordpress widget

I have this WP widget that pulls random products from the DB. What I really want is to be able to include just a few products categories (or exclude). Can anyone help me? I appreciate. <?php ...
0
votes
1answer
19 views

passing variables inside a widget add_action

Here's my code inside a widget class: function widget($args, $instance) { add_action('wp_footer', function () { echo $instance['title'] }); } It doesn't output $instance['title']. I tried passing ...
0
votes
0answers
4 views

Nested widgets in widget.php

Anyone here accomplished that? I've seen a theme that did this before but can't remember it. It allows you to drag a widget inside another widget in widgets.php, giving you the ability to create ...
0
votes
2answers
22 views

Output column number according to active sidebars

$sidebars = array( is_active_sidebar( 'footer-4' ), is_active_sidebar( 'footer-3' ), is_active_sidebar( 'footer-2' ), is_active_sidebar( 'footer-1' ...
1
vote
1answer
20 views

Remove All Widgets from Sidebar

Does someone know a solution for this? I want to remove (not unregister) all widgets from a sidebar with a function.
0
votes
1answer
12 views

How Can I Register Menus and Widgets Conditionally Based on Theme Options/Settings?

I have theme options/settings page and options/settings fields set as outlined here: ...
0
votes
0answers
19 views

Hide specific categories from category widget

I'm trying to hide a large amount of categories from my category widget. I've tried a few plugins but none of them seem to want to let me use the dropdown option. I looked into the ...
0
votes
1answer
21 views

include exception inside theme for empty widget area

Im using Storefront-paper theme for a blog, and for my sorprise, sidebar.php include a code to block possibility to have empty widget area. In this case I would like to use a page how front page, ...
0
votes
0answers
8 views

How to load individual widgets within sidebar(Not all at once)

I want to load my Wordpress site sidebar widgets when scroll down. So I want to know how to load individual widgets one by one. I tried plugins like 'Lazy Widget Loader'. But they didn't work for me. ...
0
votes
1answer
16 views

Radio buttons in widget not saving

I am struggling with a common issue that many people appear to have encountered over the years. In creating a widget I need a series of radio buttons. Using the code below I can create and show the ...
0
votes
0answers
6 views

Missing argument 2 for remove_widget_title() [duplicate]

I'm using both these functions: function widget( $args, $instance ) { // Widget output extract( $args ); $title = apply_filters('widget_title', $instance['title']); echo ...
0
votes
0answers
11 views

Get plugin option number from WordPress widget

[7]=> array(15) { ["title"]=>string(0) "" ["labelone"]=>string(0) "" ["labeltwo"]=>string(0) "" ["group"]=>string(0) "" ["member"]=>string(0) "" ...
0
votes
1answer
22 views

How to make featured area?

I'm trying to make custom wp theme, but i have one thing that i don't know how to make. I would like to make featured area on my page like this for example: http://prntscr.com/7gespg I made widget ...
0
votes
0answers
22 views

Display “A week from today” function [migrated]

I am trying to edit a php file from this plugin https://wordpress.org/plugins/sportspress/ The plugin currently has a widget that displays all events from THIS week, but what I am trying to do is show ...
1
vote
1answer
14 views

WordPress Plugins won't save

I have a WordPress website I just took over for a client so I don't have the ability to talk with the previous webmaster / the developer. The site is using a slightly modified version of the Subway ...
0
votes
2answers
35 views

Warning: Missing argument 2 for widget_title filter

Based on this question, I'm getting an error Warning: Missing argument 2 for.... This happens for some widgets those are created by plugins. -- Edit 1 -- Here's a simple widget that causes the ...
-1
votes
1answer
42 views

How to develop an extension for a simple form post and post back? [closed]

I need to develop a plugin/widget or any kind of extension for WordPress that is a like a static page and is like a Form. In this page I have a form with some input fields that is submitted to server. ...
1
vote
1answer
36 views

How to check if widget has automatic title

Some default widgets has automatic titles. Is it possible to check if widget has automatic/inserted title using dynamic_sidebar_params filter?
0
votes
1answer
14 views

Checking if widget has title not working

Here's my function which is not working: function ts_dynamic_sidebar_params($params) { global $wp_registered_widgets; $settings_getter = $wp_registered_widgets[ $params[0]['widget_id'] ...
0
votes
0answers
9 views

displaying page attachment image in custom widget

So I have this custom widget where you can select a page from a dropbox and the widget will lead you to this page. The problem is i have no idea how to display the page's attachment image. ...
0
votes
0answers
8 views

How can I add page-level settings to a widget?

I've authored a widget that has settings on the widget page, and works correctly. I would like to add the ability to set an override for the widget's settings on a specific page or post. I'm imagining ...
0
votes
0answers
5 views

Select a widget from appearance menu

i'm creating a mega menu in WordPress and i need to add a widget field to select a widget area form appearance menu than show the selected widget width the_widget( 'widget_name' ) function
0
votes
0answers
23 views

Widgets: Ajax Filtering and Add rewrite rules

I have built an Ajax filtering plugin for my widgets that works by adding url params through jQuery (when a link is clicked) and having pre_get_posts $_GET these values. These values then setup the ...
0
votes
0answers
21 views

Call outside functions to within wordpress widgets class

Hi i'm created widget for show soundcloud clips, and i'm created a function in function.php file to create info link within widgets to show explain images to how get clip id in bootstrap modal style. ...
0
votes
0answers
16 views

display widget areas by adding standard code to page address

How to view all the widget areas on a page by adding code to page address... Some time ago I saw a tutorial video on WordPress that explained how to highlight all the widget areas available on a ...
0
votes
1answer
12 views

three sidebars showing without call

code from template where i call header sidebar <div class="wrapper"> <?php get_sidebar("header"); ?> <div id="switcher"> widgets.php has following coding... <?php if ...
0
votes
1answer
32 views

Active Sidebar Conditional Question?

I have the following code that works but doesn't look good: <?php $col = 'one'; if( is_active_sidebar('footer') && is_active_sidebar('footer-2') && ...
0
votes
1answer
31 views

wp_list_categories + widget

With the code below, I added a span tag + placed the category count inside the link. add_filter('wp_list_categories', 'cat_count_span'); function cat_count_span($links) { $links = ...
0
votes
1answer
32 views

How to place a widget beside a div/text so that they display as a continuous line

An example will probably provide the best base context. I want to achieve: Headline widget (linked text/image)... linked text Point of difficulty: displaying these so that they read as one line, ...
1
vote
0answers
34 views

Post Count for Categories, however not to calculate a total

Normally this is how the category widget works. Fruits (15) - Apples (7) - Oranges (3) - Grapes (5) Apples, Oranges and Grapes contains posts, however nothing in Fruits. Lets assume that Fruits ...
-1
votes
1answer
13 views

Full Width Container Colour Problems

I wanted to duplicate a page and so I copied the code into a new page. Everything worked however one full-width container has a background colour that on the original page stretched across the whole ...
0
votes
0answers
14 views

Widget editing, pages to posts(blog)

Is there any quick way to edit this widget to show posts instead of pages? class interface_recent_work_widget extends WP_Widget { function interface_recent_work_widget() { $widget_ops = ...
0
votes
1answer
49 views

Widget stuck at particular point when dragging to bottom

This is weird, but when I try to drag a widget to the bottom of sidebar it stuck in the middle, if I hold the dragging and drag it back to top it works but I can't drag it bellow that particular ...
0
votes
1answer
29 views

How to save widget settings on field value change?

I'm developing a widget. Its form has two HTML select elements: one to display a list of all categories, and the other for displaying a list of posts based on the selected category. The posts HTML ...
1
vote
0answers
25 views

Fire on widgets_init only on dashboard

I have an interesting issue. I need to launch an action on widgets_init, but ONLY on the WordPress Dashboard. So I can't use dashboard related hooks, because they fire too late; it has to be on ...
0
votes
1answer
26 views

Always show the widget title in a wordpress widget

I'm using the default category widget to show my category list in sidebar. The problem is when I select some category to visit the corresponding category page [ex: football], the widget title [which ...
1
vote
0answers
26 views

Custom widget with WYSIWYG

I am developing a Custom Widget and i want to add a textarea with WYSIWYG editor in my widget setting . Any idea or suggestions ?? Thanks.
0
votes
1answer
36 views

How to get options of all active widgets ?

I am currently using a loop that goes trough all sidebars looking for widgets than loop those again in order to get all widgets options. Doing this on add_filter('sidebars_widgets', array($this, ...
0
votes
0answers
19 views

How to add/save/retrieve additional fields to all available widgets?

I cant seem to find any complete tutorial that shows how to add / save/ retrieve a fields to any widget. Can someone please show a simple example how to add a simple select , save the data and ...
0
votes
1answer
25 views

Best strategy for providing theme options using customizer

I am making a free distributable theme and I wish I could provide theme options in the best possible way. I have doubts (mostly about widgets) and sidebars. Here we go: Is it a good idea letting the ...
0
votes
1answer
19 views

Widget background images missing on second blog excerpt page

On my main blog page, there are category images on the left-hand side. When I click "next page" at the bottom of the excerpt list, and the second page of excerpts loads, the images are no longer ...
0
votes
0answers
46 views

use add_action('wp_head') in a widget for generating dynamic CSS styles

I have been working on a 'Custom Pop Links' widget for use in a theme which is ready for distribution. User can change the color of a link using a color picker inside widget. Untill now, I used inline ...
0
votes
0answers
14 views

Register Widget Areas from Custom Widget

Is this possible to register sidebar / widget area from a custom widget?. If you have any idea please let me know. I can create it from custom theme and custom plugin. But I want to create from ...