There are times when you want to display widgets on other locations than
your default sidebar. With such high demand for this hack, we will be
sharing how you can create multiple dynamic sidebars that are widget
ready for your WordPress blog. There are some plugins that will require
you to use the widget only, or in some cases widget is what you feel
comfortable with then this is the hack for you.
For this we need to add the following code to PHP /html editor in html mode which will generate the orignal code and then copypaste it in functions.php
Now Use this Snippet to get it on any site
For this we need to add the following code to PHP /html editor in html mode which will generate the orignal code and then copypaste it in functions.php
<?php
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => '
Left Sidebar
',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
if ( function_exists('register_sidebar') )
register_sidebar(array(
'name' => 'Right Sidebar',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h2>',
'after_title' => '</h2>',
));
?>
Now Use this Snippet to get it on any site
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar("Left Sidebar") ) : ?>Default left sidebar stuff here�
<?php endif; ?>
2 comments
I barely understand widgets. What I do know about them is that they are used to make your webpage a little bit more user-friendly. But thanks to your explanation and clear source code and seeing that I have a little background at programming I learned a lot about widgets. Thank you for the post! www.iquestintl.com
I'm so glad you enjoyed your sampler. Thanks for inspiring on this! I am very glad to read this. Really good one.
Bangalore Web Designing Company, Web Development Company Bangalore
Post a Comment