Create/Register/Display Widget Area To Your Theme Files

Register a new widget area for your website

Past following code on function.php file

Example: Type Your custom widget Name

 

if (function_exists(‘register_sidebar’)) {

register_sidebar(array(

‘name’ => ‘My Widgets’,

‘id’ => ‘my-widgets’,

‘description’ => ‘The my widgets for your website.’,

‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,

‘after_widget’ => ‘</div>’,

‘before_title’ => ‘<h2>’,

‘after_title’ => ‘</h2>’

));

}
WordPress will add a new Widget area

Call the widget in your theme template php files

Enter this code into your theme files or in the file where you want to display

 

<?php if (!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘Extra Widgets’)) :

 

always back up theme files before editing!!!!!!!

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s