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

learn more… | top users | synonyms (2)

0
votes
3answers
122 views

Show a widget as a sidebar fallback

I'm trying to find a way to show a widget only if a given sidebar is empty. I'm using Widget Logic to control some widgets, but I'm having trouble figuring out how to use it in this case. I've tried ...
0
votes
3answers
244 views

Validating widget's configuration data on Admin page

I have a simple widget that needs its width and height set by the user, so that it is displayed properly on the blog. The thing is: on the Administrator/Appearance/Widgets page, if the admin user ...
0
votes
2answers
370 views

How to make widget title accept php?

I am trying to make widgets accept php, but without resorting to plugins. So far I have enabled php for the widget_text but cant make it work for widget_title. I am using the following code in ...
0
votes
2answers
319 views

Transform php code into a widget?

how can I create a widget out of a php code? It's just a disqus code that I would like to place in the sidebar. I could just paste the code in the widget section (my tag), but then I would not be ...
0
votes
1answer
165 views

Problem since update 3.5 [duplicate]

Possible Duplicate: Stackoverflow type of badge plugin giving warnings in Wordpress 3.5 I have updated my wordpress website simpliblog.org 2 days ago. And now I can read that on top: ...
0
votes
1answer
312 views

Call plugin with php function

This plugin only works as widget. I need call this plugin with php function. How to modify this code ? <?php /* Plugin Name: AJAX Calendar Plugin URI: ...
0
votes
3answers
4k views

<?php echo get_template_directory_uri(); ?>/images/image.jpg not working in sidebar

Hoping someone can answer this! I'm using <img src="<?php echo get_template_directory_uri(); ?>/images/image.jpg"> for my header and it is working. But when I try to use it in a ...
0
votes
1answer
304 views

the_post_thumbnail call removing li in code

Need some help here. I've been working on a widget to display a list of featured posts (custom post type) and want to display the featured image for each post so I was using the_post_thumbnail call ...
0
votes
1answer
60 views

How to disable a widget when dependent plugin is inactive?

My widget has a lot of dependent plugins, and disabling one of the plugins results in erratic behavior throughout my entire WP installation. I've been trying to use the function ...
0
votes
2answers
65 views

displaying tags in a widget

I have a widget which displays the latest projects as thumbnails on my website. When I mouse over a thumbnail the project title appears; this is the code for title: <h2><?php echo ...
0
votes
1answer
682 views

Sidebar widget: Randomly select text from a given set

I have a sidebar text widget, which displays a nice quote that's related to the blog contents. I change the quote every now and then, And I'm looking for a way to create a set of quotes and display ...
0
votes
1answer
1k views

Register sidebar 'before' and 'after' html as div rather than li tags

I am making sidebars for my theme using the register sidebar function. The codex does it something like this if ( function_exists('register_sidebar') ) register_sidebar(array( 'name' => 'Right ...
0
votes
1answer
143 views

Dynamic Sidebar and XHTML Validity?

My question is concerning dynamic sidebars and wrapping the dynamic sidebar code in the <ul> tag. When I have widgets/dynamic sidebar enabled do not add widgets to the sidebar, and do not wrap ...
0
votes
1answer
224 views

Remove the Inactive Widgets

I'm looking for a function, NOT A PLUGIN, that allow me to remove the Inactive Widgets... there was a topic before Script to remove all inactive widgets? with an answer, however it's not working for ...
0
votes
2answers
620 views

How to add the same widget twice?

I noticed that if you put the same widget in two different widget slots (primary and secondary for instance) only the first one will appear on the page. The second slot will be empty. How to solve ...
0
votes
2answers
90 views

How to determine which sidebar the widget has been added to, via widget admin?

In the script below, which resides in a custom widget, I'm trying to determine which sidebar area the widget has been added to because I want to alter the default text depending on which sidebar the ...
0
votes
3answers
391 views

Modify WordPress widgets Screen

I have been searching for some time on how to modify the Widgets Administration Screen, i'm attempting to add the sidebar id to the wrapper elements. Current output: (produced by wordpress) <div ...
0
votes
2answers
473 views

Best practice for including plugin output in a template without using shortcode?

I need your recommendation for the best practice here: A custom post type I have created needs a list of attachments at the end of the post content. I have created a series of functions that handle ...
0
votes
2answers
761 views

Making tags appear as an Unordered list <ul> instead of a 'cloud'

I'm developing a a site using the wp e-commerce plugin, and it handles tags in pretty much the same way it would if I were using it for a blog instead of a store. The issue is that I want to use the ...
0
votes
1answer
152 views

Shortcode displays always first. Once again

OK, I've had a problem with echoes in my last shortcodem, but everything works fine now. But I have another one: function myWidget_shortcode( $atts ) { extract( shortcode_atts( array( ...
0
votes
2answers
682 views

Categories widget show empty?

Is there a way I can display all categories in the categories widget that comes with wordpress. I do not want to have to edit the core files and I want to stay away from rewriting the widget, but if ...
0
votes
2answers
577 views

FTP Widget Location

I am trying to recover some code I had several months ago (I have backups of everything). It was part of a text widget in my WordPress sidebar. If I have the full backup, where can I find that code? ...
0
votes
1answer
707 views

Widget Update Code Not Working

From what I can tell the widget API is pretty straight forward and simple, yet for some reason my update code isn't taking effect properly. When I press [save] from the backend all fields are blanked, ...
0
votes
1answer
274 views

Conditional Display of Links in Widgets

I want the links widget in my sidebar to display links based on the page the user is on. For example, if the user is on the home page I want it to display link1, link2 and link3. But if the user goes ...
0
votes
2answers
34 views

Can't Write Custom Widget Code In One ECHO

I am creating a WordPress custom widget and I created the below one that is working fine when I add it in function.php. <?php /* ...
0
votes
2answers
23 views

Register Script in Plugin Widget

I need to load a separate js file into a widget and just can't get it to work. So far I have if ( is_active_widget( false, false, $this->id_base, true ) ) { function tab_widget_scripts() { ...
0
votes
2answers
38 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
1answer
50 views

Check which registered sidebar a widget is added to

I have 2 registered sidebars in my theme one for Products and one for Blog. What I am trying to do is if my "Category" widget is added to the Product Sidebar the taxonomy is automatically set to ...
0
votes
2answers
42 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', ...
0
votes
1answer
152 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
2answers
164 views

Remove/Unregister or hide a widget added by a plugin

I'm trying to figure out how to remove wordpress widgets added by plugins. I know there are a couple of plugins that do this, like https://wordpress.org/plugins/wp-remove-widgets/ and ...
0
votes
1answer
103 views

Error with function in functions.php?

I am using the below function in my custom theme to load posts via AJAX. But for some reason it is breaking the WP ADMIN WIdget Drag and Drop and also showing the White Screen of Death when I uploaded ...
0
votes
2answers
221 views

How to change the default class for the widget title?

I would like to change the default class of the widget title. Currently it is h2 and I would like it to be h3. I have seen there is the option of customizing css so that h2 looks like h3. #sidebar h2 ...
0
votes
2answers
61 views

is_active-sidebar loop

So I have 4 widgets which is in large-3 columns, when they're not active I place a placeholder as user guide so the user would know where to put what. I did manage to work out the is_active but it ...
0
votes
2answers
721 views

Post-specific widgets in Wordpress 'Twenty Fourteen' theme

Using Wordpress 3.8.1 with 'Twenty Fourteen' theme I'd like to arrange my post in such a way that it's main contents go to main (center) column while galleries, attached files and links pertaining to ...
0
votes
2answers
51 views

Add Shortcode tag in Widget/Sidebar

I want to add a shortcode tag in the sidebar/widget. I am able to get the required functionality if I add the code in the theme's function.php add_filter('widget_text', 'do_shortcode'); My problem ...
0
votes
1answer
468 views

How to add Custom Fields to Settings in Widget Options for all Registered Widgets?

I want to add input box in the custom form when we click for Widget Settings. Really like to have this additional text box in all widgets be Custom Made or the default ones. I'll be needing help in ...
0
votes
1answer
30 views

How can I specify that an area of my theme contains widgets?

I am pretty new in WordPress theme development and I am developing a theme that use BootStra CSS framework I have to do that a specific area of my theme can contains some widget\module (I don't know ...
0
votes
2answers
33 views

How to use wordpress content class?

<div class="sidebar_area"> <h4>Sponsor</h4> <div class="sidebar_content"> <ul> <li><a href="#">This is new post</a></li> ...
0
votes
1answer
45 views

How to include a file only on dashboard widgets page?

I want to add some styles to the widgets input fields. Therefore I want to include a style.css file only on the wp-admin/widgets.php page. How can I detect the above page and include file there?
0
votes
1answer
414 views

How to pass a special CSS class into widget li

I have assigned a Sidebar into functions.php: register_sidebar( array ( 'name' => 'Footer Widgets Area', 'id' => 'footer_widgets_area', 'description' ...
0
votes
2answers
368 views

How to show 5 posts from specific category on related page?

I'm not familiar enough with wordpress to ask the question directly, so please bare with me as I explain what I'm looking for. I have four primary sections of my business (A, B, C & D, for ...
0
votes
1answer
261 views

How to change color of registered widget areas in admin?

Right now they are all gray. How to change the color? I mean, how to add a class or id to the registered widget area that are shown in the admin area? This is how you register the admin areas in my ...
0
votes
2answers
95 views

How to use the widget area to extend the page content?

I want to remove a widget area (lateral), and extend the page width getting this area. What is the better way to do it?
0
votes
2answers
238 views

How to use get_results() in widget front end?

I'm trying to get_results() in my widget's front end, this is my current code: public function widget( $args, $instance ) { echo $args['before_widget']; if($children = $wpdb->get_results( ...
0
votes
1answer
90 views

How to best include widget area just on homepage?

I have a front-page.php defining the homepage of my theme (a Genesis child theme). In it, I have some custom widget areas, like so: genesis_register_sidebar( array( 'id' => 'cta', ...
0
votes
1answer
132 views

Undefined Variable in my widget

I'm trying to get my head around writing custom widgets with options. I've been following a few tutorials and have been trying to understand as I go. I've got a widget that works perfectly in the ...
0
votes
1answer
86 views

Making a Multisite Dashboard Widget

I tried to use the code from this question: How to Check Disk Space used by Media Library But it's displaying this error in a Multisite: How can I display it on my network Dashboard instead root ...
0
votes
2answers
408 views

register child class in another plugin

I think this should be relatively easy, but somehow I cannot figure out how to do this. essentially there's a preexisting plugin that does this: add_action('widgets_init', create_function('', ...
0
votes
1answer
157 views

Update widget form after drag-and-drop “only specific plugin”

This solution, Update widget form after drag-and-drop, works correctly but I want to adapt this function to affect only a specific plugin and not every plugin. How could I do it?