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

learn more… | top users | synonyms (2)

0
votes
2answers
400 views

One register_sidebar function works, the other doesn't?

Here's how I have my code set up in the functions file: register_sidebar(array( 'name' => 'Latest Updates', 'before_widget' => '<span>', 'after_widget' => '</span>', ...
0
votes
1answer
171 views

How to use widget in a widget-less WordPress theme?

I have a widget-less WordPress theme to which I want to add Subscribe by Email functionality. Unfortunatly the plugin only comes in the form of a widget. How can I use the widget functionality ...
0
votes
2answers
628 views

Possible to preset a widget's contents via a plugin script?

This plugin is a simple demo test to see if I can dynamically populate a pre-existing widget area with text. In this case, my theme has created the widget area "home-header-widget" and I'm trying to ...
0
votes
4answers
3k views

Is there a WordPress widget for my webpage?

I'd like to show a summary of my recent posts on my homepage. (Like the headlines and perhaps a few lines of text.) My site is not running on WordPress. Is there a code snippet for that? Edit: When ...
0
votes
5answers
3k views

Display some arbitrary HTML or content in a sidebar [closed]

I need to have a bit of frequently changing content in a sidebar (the time and location of the next meeting of a club). What I'd really like is a nice widget that displays the_content() of a selected ...
0
votes
7answers
381 views

Related posts widget or plugin needed

I'm looking for something like they are using here: http://www.jennyreviews.com/as-seen-on-tv/triple-joint-formula/ Look under "Related Product Reviews" I checked the source but could not find the ...
0
votes
1answer
47 views

Wordpress widget title coding

I have a problem with wordpress widget titles, some widgets are not affected by theme custom encoding. Here is the codes; function ecce_widget_title($title){ if( empty( $title ) ) return ' '; else ...
0
votes
2answers
309 views

Hide widget to non-logged in users without plugin (functions.php) [closed]

I am working on a Woocommerce Wordpress site. I want to hide a widget in frontend to non-logged in users. The widget is "filter by price" from Woocommerce. I'm also using the "Catalog Visibility ...
0
votes
2answers
35 views

Is it acceptable for a WordPress theme to not accept widgets?

I'm developing my own WordPress theme, and I was going through the Theme Unit Test as described by the Wordpress Codex. Now, at some point, the Codex mentions that I should verify that All widgets ...
0
votes
1answer
28 views

Dashboard Widget drawn before opening HTML tag

I am making my first dashboard widget and it is displaying successfully but the output HTML from the function below is showing up before the opening HTML tag on dashboard page. The code involved is ...
0
votes
3answers
128 views

Text Widget in Footer for just 1 page template

I am building a wordpress website and I want to show a text widget in the footer just for one page template. That widget shouldnot be seen for other pages. Is there any possible way for that?
0
votes
2answers
1k views

Custom Sidebar only on single post

I am developing a child theme for the new twenty thirteen theme and I am trying to add a sidebar (widget area) next to my content. I only want it to display in single posts. What I did: edit ...
0
votes
3answers
132 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
271 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
423 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
358 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
166 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
330 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
5k 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
313 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
61 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
66 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
727 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
144 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
235 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
645 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
92 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
399 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
515 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
784 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
153 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
743 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
619 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
743 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
275 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
1answer
39 views

I want to create a posts widget and be able to select categories

Can you please tell me how can I create a wordpress posts widget that outputs posts based on a categories selection ( category checkboxes of all the post categories ) This is in my form function: ...
0
votes
1answer
19 views

Why isn't a list of posts from my custom post type displaying in this widget?

I have a custom post type called 'blog' . I wish to show a selected number of posts from this custom post type in a widget. But all I get is 'No listing found,' which is the else statements if no ...
0
votes
2answers
31 views

'is_author()' logic in widget for author only

So, I have a widget that I only want to show it to the page author. I used the following logic: is_author() However it does not seem to work (it shows non-author) Am I using this logic right? Any ...
0
votes
2answers
54 views

how to display custom widget anywhere in wordpress

i've a custom widget for ads,it helps me to show ads on sidebar but i'm trying to display it under every single post or on front page near to slider. <?php the_widget( 'AdWidget_300' ); ?> ...
0
votes
2answers
57 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
30 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
56 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
58 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
53 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
190 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
285 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
107 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
386 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
64 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 ...