Bootstrap Templates Bundle

Monday, January 7, 2013

How to use sidebar in post content without editing themecode

Step 1.  At first create a widget or sidebar by copy/paste this below code to your fuctions.php file

if ( function_exists('register_sidebar') )
register_sidebar(array('name'=>'sidebar1',
'before_widget' => '',
'after_widget' => '',
'before_title' => '<h4>',
'after_title' => '</h4>',
));

*You can change your sidebar name by replacing 'sidebar1'

Step2.  Download a plugin php-code-for-posts.1.0  by clicking here
            This plugin will help you to add php code to your content. Just install this plugin and go to PHP code option of your dasboard


Step3.  After going   PHP code menu click on add new button , then paste this below code there

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

* You can style your sidebar, click here how to do that

Step4. After saving you will get a code below shortcode option. Copy that shortcode and paste where you want to show your sidebar. Remember you need to add widget into the sidebar ( from Appearance> Widgets )  that you have create, suppose Recent posts,Text,  Archive etc. Otherwise you can't see anything on you output.

If any problem Visit  bestcareerbd.com

No comments:

Post a Comment

Wokiee React eCommerce Template