Step 1 : Create Widget

This code is copy.

register_sidebar( array(
‘name’ => __( ‘Your Widget Name’, ‘twentytwelve’ ),
‘id’ => ‘your-widget-name’,
‘description’ => __( ‘Appears when using the optional Front Page template with a page set as Static Front Page’, ‘twentytwelve’ ),
‘before_widget’ => ‘<aside id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</aside>’,
‘before_title’ => ‘<h3 class=”widget-title”>’,
‘after_title’ => ‘</h3>’,
) );

Insert function.php file in around line number 270 :
project/wp-content/themes/yourtheme/functions.php.

 

Step 2 : Display Widget

This code is copy.

<?php if (!function_exists(‘dynamic_sidebar’) || !dynamic_sidebar(‘your-widget-name’)) : ?><?php endif; ?>

Insert in this directory : project/wp-content/themes/yourtheme/yout-template-file.php.

Advertisements