Tags

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