A Sidebar is a theme feature introduced with Version 2.2. It's basicly a vertical column provided by a theme for displaying information other than the main content of the web page. Themes usually provide at least one sidebar at the left or right of the content. Sidebars usually contain widgets that ...

learn more… | top users | synonyms

21
votes
2answers
6k views

Programmatically add widgets to sidebars

I would like to programmatically add widgets to my two sidebars that I've got. I couldn't find any official way of doing it? I started looking in the database. I've found that it's the ...
10
votes
4answers
3k views

Limit number of Widgets in Sidebars

If I use a custom widgetized area (for example footer) where there is only a limited number of spots for widgets (by design), can I limit the number of widgets the user may include in that specific ...
9
votes
3answers
7k views

Loading scripts only if a particular shortcode or widget is present

I needed a way to filter a page/posts content before it was loaded so I could add scripts to the header if a specific shortcode was present. After much searching I came across this on ...
8
votes
3answers
3k views

Custom Post Type Data in Sidebar widgets?

(note: this question was originally about Custom Fields, but @MikeSchinkel had a better solution involving Custom Post Types) On my site I have several pages which I want to show the same data in the ...
7
votes
2answers
4k views

List all sidebar names?

I'm listing all sidebars like that: global $wp_registered_sidebars; echo '<pre>'; print_r($wp_registered_sidebars); echo '</pre>' So I'm getting something like: Array ( ...
7
votes
3answers
2k views

Limit widget to certain sidebar?

I have multiple "sidebars", but not all of them are the same size. Not all widgets fit in all sidebars (for example, I have a "footer sidebar" where the client can place custom widgets, but they are ...
6
votes
1answer
3k views

Get list of all registered sidebars

I am registering sidebars automatically for each category (a separate widget space per category). The technique I'm using is here. In the admin side I have an options page where I need to display a ...
6
votes
7answers
2k 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 ...
6
votes
1answer
364 views

Display Random Author with Details in Sidebar

PHP newbie here, recently decided to have a stab at cobbling together a kooky little 'Random Author Spotlight' feature into my current WordPress theme. I'm almost done, but I've hit something of a ...
6
votes
3answers
1k views

How Do I Add Custom CSS To Only Certain Widgets

I have a standard dynamic sidebar using register_sidebar and dynamic_sidebar and I need the last widget in the sidebar (which will not have a set number of widgets) to have a distinct class ...
5
votes
5answers
6k views

How to Show Different Sidebars on Specific Pages?

I'm making a blog where only on specific pages I want to show different sidebar, I will add some widgets to those sidebar, which I don't want to show in default sidebar. I've found a coding method to ...
5
votes
1answer
8k 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 ...
5
votes
2answers
92 views

Retrieve each widget separately from a sidebar

I would like to retrieve each widget existing in a sidebar in order e.g. to mix them with posts inside the main loop. I know I can use different widget areas (sidebars) but this approach clutters the ...
5
votes
2answers
2k views

Add the sidebar/widget editor to the post edit screen?

There are (among others) two common ways of customizing the sidebar on an individual post: Create a new sidebar for the post, using code or plugins like Custom sidebars, WP Custom Sidebar, Per Page ...
4
votes
5answers
3k views

Different widgets on different page templates?

If I have a couple of different Page templates, how would I show a different collection of sidebar widgets for each of these templates? I'm using the Starkers theme as a starting point.
4
votes
1answer
618 views

Highlight custom widgets in the admin area?

I have created some custom widgets for my client to use, but I want to make them stand out amidst the fifteen or so standard widgets in the admin area. How can I do this? I have solved this problem ...
4
votes
5answers
2k views

Sharing Dynamic Sidebars across Multisite Blogs

I'm trying to find away to retrive a dynamic sidebar from one blog and print it on another blog in the same install of Wordpress Multisite. I have tried switch_to_blog($blog_id); ...
4
votes
1answer
1k views

Getting the Next and Previous Posts Titles in the Sidebar?

Let's assume that I have the following posts with the following titles: PostA (is assigned to the 'category 1') PostX (category 2) PostB (category 1) PostC (category 1) PostD (category 1) PostY ...
4
votes
2answers
2k views

Get sidebar parameters (before_widget, before_title, etc.) from within a widget

Is it possible to dynamically get sidebar parameters from within a widget? That is, I am trying to access the before_widget/after_widget/before_title/after_title/name parameters of the containing ...
4
votes
1answer
518 views

Video Embed in Sidebar Widget with Links to Others in Category

I am trying to re-create the sidebar widget found here: http://www.clinicalforensicpsychology.org/ The links below the shown video are linked to the post category "videos". I have tried most every ...
3
votes
2answers
4k views

is_home() and is_single() Not Working as Expected with Custom Post Types?

(Moderators note: Was originally titled: "Custom post type problem?") I'm having some problems with custom post types where everything is working great except for the sidebars. Here is some code ...
3
votes
3answers
2k views

Get number of widgets in sidebar

How can I get the number of widgets that are active on a specific sidebar? Is there a core function for this? I want to add a class to each widget on a sidebar based on how many of them are ...
3
votes
2answers
2k views

Getting post-thumbnails from another WP site

I have two WordPress installations, one at http://inversekarma.in and the other at http://inversekarma.in/photos. The latter is a photoblog, and its theme uses the standard WP post thumbnails (EDIT: ...
3
votes
4answers
4k views

Custom per-page sidebar widgets .. possible?

Let's say I'm doing a site about cars, and in the main content area of a Page (using a certain template), there are a few paragraphs about a particular car. In the sidebar, are several standard ...
3
votes
2answers
665 views

How To Determine If A Filter Is Called In A Sidebar/Widget Context?

So I have a plugin that appends or prepends an enhanced author biography to the content of a page/post/custom post type. It does this by hooking to either the_content or the_excerpt and ...
3
votes
1answer
1k views

Getting an ordered list of tags - via wp_tag_cloud or not?

I'm trying to output an ordered list of the top five tags for my site into the sidebar. At the moment, I'm using wp_tag_cloud like this to get it to output a nice <ul>: ...
3
votes
3answers
2k views

Hooking a function onto the sidebar?

I'm looking for a way to add some content to the top of the sidebar when it get's loaded. I've tried hooking onto the get_sidebar action as referenced here, but it seems to override the sidebar call ...
3
votes
1answer
1k views

How to add author details in the post sidebar?

I would like to add author details in the sidebar instead of bottom of the post? Can anyone tell me how to do that? As of now i'm using like this in the loop <?php $curauthor = ...
3
votes
2answers
1k views

Override dynamic_sidebar() in plugin?

I'm writing a custom plugin that allows a particular page to have it's own sidebar with widgets. It works great so far, but what I'd like to do is generalize it more and allow the plugin to ...
3
votes
1answer
322 views

Display comment form of specific page in sidebar

I want to display the comment form of a specific page on a sidebar. It will look like this roughly. I tried modifying from comments.php and putting it on sidebar.php. But nothing shows up. ...
3
votes
1answer
264 views

Determining a Widget Instance and Sidebar Location?

When using the filter: add_filter('widget_display_callback', 'function_name'); function function_name($instance) { /* Some Code */ return $instance; } Is it possible to determine the sidebar ...
3
votes
1answer
215 views

Add a select box to all widgets

I would like to add a default select box to all widgets placed in the sidebars of my site. This would allow to choose the color of the associated widget. Do you know how i can make this ? I know how ...
3
votes
1answer
458 views

Problems with the sidebar args and wp_list_bookmarks

I have run into an issue trying to use the sidebar args (before_widget,after widget,after_widget,before_widget) as theme style friendly parameters for the function wp_list_bookmarks, that is that the ...
3
votes
1answer
521 views

Registering Sidebars and Sidebar Widgets. Sidebar Widgets Not Displaying

I am registering sidebars and sidebar widgets. The theme currently supports two sidebars. Primary and Secondary. add_action('widgets_init', array($this, 'add_sidebars'), 10, 2); public function ...
3
votes
1answer
758 views

Manual display of widget

I currently have a widget that needs to be manually displayed on the front page. The rest of the pages it shows up in the widget sidebar, (this is accomplished with 'Widget Logic') but on the front ...
3
votes
1answer
882 views

Get the sidebar ID in which the current widget was dropped

How can I find out in which sidebar was a widget dropped? From inside that widget. More precisely from the form() function. Can I automatically remove the widget if it's not added in the appropriate ...
3
votes
2answers
318 views

Sidebar Generator issue

I hope this doesn't come across as very dumb (to some extend it is, however), but I am having a hard time dealing with the Sidebar Generator. In the description it is stated that "Now supports themes ...
3
votes
1answer
277 views

Sidebar Widget Registration without a name, how is it assigned to new named sidebar widget?

In my current theme version, I'm registering sidebars with names. However, in previous versions, I only had one sidebar and registered it without a name like so... if ( ...
2
votes
6answers
6k views

Including Custom Post Types in “Recent Posts” Widget

I'm able to easily include my custom post types into my main loop by making small adjustments with query_posts(), but I'm not sure how I would go about including custom post types in the "Recent ...
2
votes
2answers
4k views

Give Editor Access To Sidebar

I want to give the Editor Role access to editing the sidebar and it's contents. I have a text widget in there and in order to edit this text widget the user needs to be an admin - this sucks. How do I ...
2
votes
2answers
50 views

Advice: Template structure - php blocks in sidebar or someting else?

I'm trying to create certain modulair blocks which I can add to multiple pages in Wordpress. But I use sidebar-[name].php files for this, what is the best practice for this? Should you add them to a ...
2
votes
2answers
246 views

Worpress twenty eleven sidebar on Pages

I am using 2011 theme, any how I managed to get sidebar on single.php pages by installing child theme, But now I want sidebar on pages, How do I get it?
2
votes
1answer
151 views

register sidebars

i registered my sidebars as follows: $sidebars = array ( 'sidebar-10' => 'Hoof Sidebar', 'sidebar-11' => 'Tuisbladsy area een', 'sidebar-12' ...
2
votes
1answer
54 views

Text snippets shared across posts

I'd like to add a "fast facts" section to a wordpress site - an area in the sidebar where snippets of text are rotated. Where is the best place to store things like this? Widgets don't really allow ...
2
votes
2answers
1k views

customizing recent posts

Im working on my first wordpress blog and trying to avoid plugins if at all possible for a lot of what doesn't really need to have a plugin. I am slightly familiar with php ( I don't understand it but ...
2
votes
1answer
77 views

Adding content to sidebars

I am working on a three-column layout where all three columns will have differing content depending on the post/page in the main column. How would I go about giving the ability to change and update ...
2
votes
3answers
3k views

How to exclude parent category but show child categories?

I figured out how to exclude the current post from displaying in my single-post view sidebar, but now I want to exclude parent categories and display only children. Any ideas how to do this? Much ...
2
votes
1answer
52 views

List sidebars on a page

I need to generate a list of sidebars on a given page. I know how to list all sidebars that have been registered, and all sidebars that have been registered that have active widgets, but I do not know ...
2
votes
3answers
413 views

wordpress widget textbox in the sidebar

I have a normal textbox widget that I am using in certain sidebars. The text widget generates a div within a ul. Is there anyway to make the widget generate another ul li instead? ...
2
votes
1answer
815 views

WordPress Widget multiple use

I created this widget using a simple example on WordPress Codex: <?php function widget_container_latest_posts() { global $wpdb; global $post; ...