Widget Area

Untitled-2

Create widget area in theme…

add this code in function.php


function arphabet_widgets_init() {

	register_sidebar( array(
		'name'          => 'Footer Area 1',
		'id'            => 'footer_1',
		'before_widget' => '',
		'after_widget'  => '',
		'before_title'  => '<h5>',
		'after_title'   => '</h5>'
	));
	
	register_sidebar( array(
		'name'          => 'Footer Area 2',
		'id'            => 'footer_2',
		'before_widget' => '',
		'after_widget'  => '',
		'before_title'  => '<h5>',
		'after_title'   => '</h5>'
	));

	register_sidebar( array(
		'name'          => 'Contact Us Widget',
		'id'            => 'contact_us',
		'before_widget' => '',
		'after_widget'  => '',
		'before_title'  => '<h5>',
		'after_title'   => '</h5>'
	));

}

add_action( 'widgets_init', 'arphabet_widgets_init' );

 

To call Widget in theme just paste this code

<?php if ( !function_exists('dynamic_sidebar')) : dynamic_sidebar( 'footer_1' ); endif; ?>
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 )

Google+ photo

You are commenting using your Google+ 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 )

Connecting to %s