You are here: Home » Wordpress » Create Own widgets in wordpress

Create Own widgets in wordpress

135 Flares 135 Flares ×
register_sidebar(array(

		'name' => 'New Widgets',

		'before_widget' => '<div id="%1$s" class="widget %2$s">',

		'after_widget' => '</div><div class="clear"></div>',

		'before_title' => '<h4 style="display:none;">',

		'after_title' => '</h4>',

	));

Put above code under function_exists(‘register_sidebar’) in function.php

Put this code wherever you want to show the widget output:-

 <?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('New Widgets') ) : ?> <?php endif; ?>

About Abhishek Sinha

I am Abhishek and I love to code on PHP.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Scroll To Top
135 Flares Twitter 6 Facebook 4 Google+ 6 StumbleUpon 15 Pin It Share 100 LinkedIn 4 135 Flares ×