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

learn more… | top users | synonyms (1)

0
votes
1answer
1k views

Help me out with this Undefined index ?

I'm working on flickr Wp-widget. Here is code to fetch flickr pics. class imperia_flickr extends WP_Widget { function imperia_flickr() { $widget_ops = array('description' => 'This ...
0
votes
1answer
183 views

how to create theme based widget that can be drop in sider bar or footer

I am developing a installable theme in wordpress I have created a contact form and called that form in footer but I want to create a widget that should be theme based mean i dont want any plugin.I can ...
0
votes
2answers
105 views

Disabling plugin but wpenqueue is not available

I'm trying to disable a few plugins when my mobile theme is loaded. I read somewhere about using this particular function in my mobile theme functions.php file to remove scripts and css. //Disable ...
0
votes
2answers
383 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
3k views

Can I ignore caching of a plugin in W3 Total Cache?

I currently have a plugin that lets me display a random post in a widget. The problem is that if I activate w3 total cache it will only display that post as long as the cache hasn't been cleared. Is ...
0
votes
1answer
164 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
590 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
378 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
42 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
115 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
1answer
38 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
270 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
34 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
21 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
93 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
3answers
105 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
1answer
441 views

Why are my widgets not saving when being added to a sidebar?

The following is in my function.php file. I see the sidebar in my Appearance > Widgets page but whenever I drag something on over the sidebar and save it just disappears once I leave the admin ...
0
votes
3answers
195 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
286 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
293 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
282 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
3k 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
276 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
57 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
64 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
570 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
900 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
141 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
212 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
565 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
89 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
368 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
425 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
721 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
146 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
514 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
645 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
269 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
23 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
58 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
52 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
78 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
65 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
52 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
462 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
43 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
29 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 ...