Tagged Questions

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

learn more… | top users | synonyms (1)

7
votes
7answers
3k views

Individual Widgets per Page

In my (page-only, no posts) Wordpress site I have a number of static blobs in need to put in a sidebar. We could call/tream thoses 'blobs' as widgets. At least they'll have a fixed html content, like ...
5
votes
1answer
119 views

Add filter to blogroll widget

I'm trying to add <i class="icon-ok"></i> before the content inside the <li> of the blogroll widget. I'm assuming that's done through the link_title filter, but I can't find a ...
0
votes
1answer
270 views

How to add a recent post function to a text widget I created for practice?

I am currently being trained to create widgets and my mentor has asked me to create a text widget then add the ability to display the 5 most recent posts (all categories) on it. I am a little stumped ...
0
votes
1answer
116 views

Saving widget options from class method

I have a widget class (derived from WP_Widget) that has a method (called via ajax) to update part of its options(the elements order) without the user to click "Save", to set the handler I do from the ...
1
vote
2answers
300 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
403 views

Dynamic Sidebars & Echo

I can sucesfully get my dynamic sidebar to work like so: <div class="sidebar sidebar-first"> <ul class="widget-area first"> <?php dynamic_sidebar( 'pop-photos-sidebar' ); ...
0
votes
1answer
1k views

disable default widgets in Responsive theme

Theme: Resposive I have added "Widget Context" and has set it to show a widget only on the start side. This works perfectly BUT on all other sides there shows a default widget "Home Widget 1" with a ...
0
votes
1answer
42 views

How to create a widget on witch a registered user can create a checklist

I have no idea where to start. I want to create a widget. with the following features show a button to create a checklist. Show a list of already created checklists created by the user. Mark ...
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
1answer
45 views

Wordpress Hide Widget If $_Session Is Active?

I was wondering if there is an easy solution to add some php "if" code when my website tries to show the widgets and if it has $_SESSION I set on homepage (based on the source of which they came) not ...
1
vote
3answers
7k views

Woocommerce Product Category Widget - hide categories that have no products in stock [closed]

I'm using WooCommerce on my Wordpress site, and have a widget in the sidebar showing all product categories. It's setup to hide empty categories, and that works well. However, it still shows ...
0
votes
1answer
24 views

pre-upload text and video for the future

I want to upload text and a video for a future date. On that future date, a new post/html is added to the site (without me doing anything that day).
1
vote
2answers
218 views

Style the archives/category sidebar widget via theme

I would like to change the appearance of the categories and archives widgets in the sidebar such that each category/month alternates the row color. The only way I know how to accomplish this requires ...
5
votes
4answers
3k views

Adding a div to wrap widget content after the widget title

I'm trying to add a div to a widget's content in my dynamic sidebar. Here is the register code; register_sidebar(array( 'name' => "Sidebar1", 'id' => 'home-sidebar-1', ...
1
vote
1answer
2k views

Calling widget via function in themes files (hard code)

Finally I finished to write my widget, and now want to call it using function inside themes php files. My widget looks like this: function reg_custom_widget() { ...
0
votes
1answer
3k views

How to add social buttons like facebook and twitter in the footer of a theme?

Hi I own the blog camilamfotografia.com.br and I'd like to add social buttons in the footer or in the navigation menu to link my site to facebook twitter flickr pinterest etc... I have tried without ...
0
votes
1answer
750 views

Widget update function not saving values

Hello WordPress Answers! I'm having trouble with the widget update function saving values correctly, but first let me explain the situation. I'm writing a simple news ticker widget plugin, which ...
1
vote
1answer
293 views

How the widget can be run by shortcode

I have my own widget, that uses WP_Widget class, and executes its code inside function in this class. Is there any ways to run this widget using shortcode inside post? This is how my widget ...
1
vote
1answer
134 views

Custom page sidebar using Template dropdown box

i am wondering how i go about making a Template for some of my pages to use a different sidebar? I have created the widget like this: register_sidebar(array( 'id' => 'ourPat-sidebar', ...
2
votes
1answer
103 views

duplicate sidebar

I have a problem with a sidebar. I have 4 sidebars: "Essential", "Essential+", "Premier" and "Premier+". register_sidebar( array( 'name' => __('Essential Plan'), ...
0
votes
3answers
1k views

Using wp_dropdown_categories in widget options

I have a product search widget when you select certain products a hidden field is shown. I would like to set a custom category in my widget options that is then used for displaying my hidden field. ...
1
vote
2answers
2k views

Is It Possible to Restore Accidentally Deleted Widgets?

I accidentally deleted the widgets without dragging it to the inactive widgets section. I have a backup of all the files and the database but i have changed many things on the site other than the ...
1
vote
1answer
747 views

How to Remove ALL Widgets from Dashboard?

I'm looking for a complete blank Dashboard. No widgets at all and preferably one column. There are snippets to remove the default WordPress widgets, but haven't found nothing about the ones added ...
0
votes
1answer
95 views

Trying to output a “Most visited blogs” list in wordpress multisite

Does anyone know how to get a "most visited" list out of Wordpress Multisite? I got alot of bloggers and have been looking for a way to output a top 10/20 list of most visited blogs, but cant find ...
29
votes
4answers
6k views

Where to put my code: plugin or functions.php?

Is there an easy to understand scheme to decide what kind of code belongs to a plugin or the theme’s functions.php? There are many cases and many debates about that topic, mostly because there are ...
0
votes
1answer
306 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: ...
1
vote
2answers
195 views

How to check if searchform.php is being included as widget?

I'd like to put something like this in searchform.php: <?php if($widget){ ?> //load serach form for sidebar... <?php }else{ ?> //load different search form for page content (404 ...
1
vote
2answers
3k views

Wordpress Custom Menu Widget Style

I am wondering if anyone knows the best method for splitting 1 custom menu widget (located in my sites footer) in to 2 columns. There are a total of 8 links, so I would like it to be split in to 2 ...
1
vote
1answer
177 views

I want to display custom text widgets for each post in the sidebar?

Ideally I am looking for two text boxes added to the 'Add new post' admin page, and the data from those two boxes be displayed in the sidebar when viewing the post page. So the sidebar displays the ...
0
votes
1answer
44 views

Show or hide a widget from pages

I want to add a check option to the wordpress admin sidebar when I am writing a post or a page to display a specific widget. I tried display-widgets plugin but I want to be able to show a widget ...
0
votes
2answers
3k views

WooCommerce Layered Nav Widget [closed]

Has anyone used the "WooCommerce Layered Nav" widget. I wonder if the attributes could be visible on the single product page?
1
vote
0answers
32 views

How to hook into unregistering a widget instance?

I would like to hook into a widget instance after it is removed from a sidebar panel on the Appearances -> Widgets admin page. So if the instance was an active widget and then removed, I would like ...
1
vote
0answers
27 views

Theme development: Pre-activated widgets [duplicate]

Possible Duplicate: Programmatically add widgets to sidebars Is it possible to develop a theme that has certain widgets automatically activated when the theme is activated? For example: ...
3
votes
3answers
336 views

How do I save data from submitted form from widget

I'm looking over internet for some simple solution of email subscription widget but no luck. Or they are too complicated and paid, or they are relaying on some external email functions. I'm not a ...
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
2answers
60 views

How can I re-register my blogs widgets?

I deleted my wp_options database file in error. I replaced it with a clean install file. Now my widgets are still present in my widgets area but none are recognized by wp. Am I right in thinking ...
0
votes
1answer
82 views

Add individual <hx> tag to widget title in sidebar

In my sidebar every widget title is enclosed in <h2> tags. I use 4 widgets in my sidebar and I'd like to have the first 2 widget titles as <h2> and the other 2 as <h4>. I changed ...
0
votes
1answer
199 views

dynamic sidebar in front page

I am developing TwentyTen child theme and wish to display dynamic sidebar on front page, but something is not quite right. I modified loop-page.php: <div class="entry-content"> <?php ...
0
votes
1answer
367 views

Widgets: Show Recent Posts Only if the Posts Have Both Categories X and Y

I've been trying to create a Recent Post widget where it only show/display posts that have both categories X and Y (or more). The categories X and Y is user-defined, so I'm planning to make it look ...
0
votes
1answer
167 views

Author Link in Recent Posts Widget

I want to add author link into the recent post widget. For example if any user post on my web from his LinkedIn ID (which I have allowed) so in Recent Posts where it shows, <time> By: ...
1
vote
3answers
652 views

Wordpress widget/sidebar dividers?

I have a widget sidebar, but I'd like dividers between them. I can achieve this in CSS using boring borders, but I have a png image I'd rather use instead. Is there a way to insert a divider after ...
3
votes
1answer
710 views

What is this instance variable doing in the Widgets class

The lack of documentation for the WP_Widget class is driving me mad. Here is what I have salvaged off the codex: public function form($instance){ ?> <label for="<?php ...
1
vote
1answer
278 views

Dashboard widget custom positioning?

I cannot figure out how to arrange my custom widgets one left and one right. I'm using this code to create custom widgets: //Add my comments. Shows user his last 5 comments function ...
1
vote
1answer
141 views

Simple widget causing whitescreen

This widget code is causing my WP site to white screen. I've re-factored the code about 5 times trying to solve it, but no luck. <?php class latest_mag_issue_widget extends WP_Widget { ...
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
1answer
129 views

event organiser not loading in main content area

there is possibly a very simple answer for this, but im afraid im a novice at this stuff :( on my wordpress site Im using the event list shortcode in the main content area and the calendar in the ...
0
votes
2answers
391 views

Recent Comments from Specific Category Widget

I've been trying to create a sidebar widget to display recent comments from specific category. I'm having difficulties in determining how Wordpress knows from which categories the comments are. I ...
0
votes
1answer
139 views

How do I create Widget within plugin that uses its own class?

I wrote WordPress plugin and want to include 2 extra Widgets with it... if( !class_exists('plugin_name') ) { class plugin_name { // plugin code } } // include widgets code ...
4
votes
2answers
4k views

check if registered sidebar is active & has widget content

I'd like to check if a registered sidebar has widget content - but can't seem to find a WP function for this - is_active_widget checks if it has content, but not if it exists or not. function ...
0
votes
2answers
328 views

Widget queries even when there are no sidebars?

I'm trying to reduce my database queries. I don't have any sidebars or widgets set but I noticed the following query SELECT option_value FROM wp_options WHERE option_name = 'widget_pages' LIMIT 1 ...