wordpress

the best code for sidebar

in function file

<?php
if(function_exists('register_sidebar'))
register_sidebar(array(
'id' => 'your_sidebar_id',
'name' => 'your_sidebar_name',
'before_widget' => '<div>',
'after_widget' => '</div>',
'before_title' => '<h3>',
'after_title' => '</h3>'
));
?>

to call it in any page write

<?php if(function_exists('dynamic_sidebar') && dynamic_sidebar('your_sidebar_id')):?>    <?php 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 )

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