Return to Snippet

Revision: 32579
at September 29, 2010 08:01 by jschultz76

Initial Code

/* the following goes into the functions.php file */
if (function_exists('register_sidebar')) {

		'name' => 'My Custom Widget',
		'id'   => 'my_custom_widget',
		'description'   => 'Widget area for home page center left column',
		'before_widget' => '<div id="widget-id" class="widget %2$s">',
		'after_widget'  => '</div>',
		'before_title'  => '<h2>',
		'after_title'   => '</h2>'




/* this goes into your template file where you want the widget to appear */


<?php if (function_exists('dynamic_sidebar') && dynamic_sidebar('my_custom_widget')) : else : ?>
	<div class="widget">
		<h2>Widget Ready</h2>
		<p>This my_custom_widget is widget ready! Add one in the admin panel.</p>
<?php endif; ?>

Initial URL

Initial Description
The code below is used to create a custom widget area in a WP template

Initial Title
Custom Widget in WordPress

Initial Tags

Initial Language