The case of the disappearing WordPress widgets The case of the disappearing WordPress widgets

The case of the disappearing WordPress widgets

A silly one this time

The Problem

I was recently working on someone else’s WordPress theme that made extensive use of WordPress Widgets and the new dynamic sidebar feature.  I was able to recreate the widgets (there was a working staging site) but the on the production site the widgets did not appear.  What to do about disappearing WordPress widgets?

The Cause

I had changed the name of the theme.  For some reason the register_sidebar has to have the name hard coded, for example

register_sidebar( array(
		'name' => __( 'Banner Area', 'themename' ),
		'id' => 'Banner-area',
		'description' => __( 'Banner area', 'themename' ),
		'before_widget' => ' <div>',
		'after_widget' => '</div>',
		'before_title' => '<div><h1>',
		'after_title' => '</h1></div>',
	) );

The Solution

Just change the name of the theme to the new name and you’re all set!

 

Written By Steve French

 

Leave a Reply

Your email address will not be published. Required fields are marked *






Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.