/ Published in: PHP
                    
                                        
The code below is used to create a custom widget area in a WP template
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
<?php
/* the following goes into the functions.php file */
'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>'
));
}
?>
<?php
/* this goes into your template file where you want the widget to appear */
?>
<div class="widget">
<h2>Widget Ready</h2>
<p>This my_custom_widget is widget ready! Add one in the admin panel.</p>
</div>
<?php endif; ?>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                