How to Add Left Sidebar?
-
Hi, I wanted to add a left sidebar to my website, so it can be converted to a 3 column blog. How would I do that? Thanks
-
this one a bit tricky and need some customization, here goes
create new php file name meso-custom-functions.php in wp-content/ and add this code.
// add sidebar left function dez_add_sidebar_left() { ?> <div id="left-sidebar" class="sidebar"> <div class="sidebar-inner"> <div class="widget-area the-icons"> <?php if ( is_active_sidebar( 'left-sidebar' ) ) : ?> <?php dynamic_sidebar( 'left-sidebar' ); ?> <?php endif; ?> </div> </div><!-- SIDEBAR-INNER END --> </div><!-- LEFT SIDEBAR END --> <?php } add_action('bp_after_content','dez_add_sidebar_left'); // add sidebar left style function dez_add_sidebar_left_style() { print "<style type='text/css' media='all'>"; ?> #custom #post-entry {float: right;width: 72%;} #custom #left-sidebar {padding:10px 0 0;float: left;width: 25%;} #left-sidebar h3.widget-title {padding: 0% 0% 10px;font-size: 1.25em;margin: 0px 0px 0.5em;float: left;width: 100%;color: #333;text-transform: capitalize;border-bottom: 5px solid #52C0D4;} <?php print "</style>"; } add_action('wp_head','dez_add_sidebar_left_style'); // add sidebar left widget function dez_add_sidebar_left_widget() { register_sidebar(array( 'name'=>__('Left Sidebar', TEMPLATE_DOMAIN), 'id' => 'left-sidebar', 'description' => __( 'Left sidebar widget area', TEMPLATE_DOMAIN ), 'before_widget' => '<aside id="%1$s" class="widget %2$s">', 'after_widget' => '</aside>', 'before_title' => '<h3 class="widget-title">', 'after_title' => '</h3>', )); } add_action( 'widgets_init', 'dez_add_sidebar_left_widget',10 );
Ok Great! I have done that……
I Fallowed Your Instructions But Got Blank Website After Adding “meso-custom-functions.php” In /wp-content/, then i deleted “meso-custom-functions.php” and get my website back.
what can be error?
Any solution?
Your Theme is great, Thanks for theme.did you forget the opening <?php and closing ?>..
Hello,
I am using MesoColumn Theme, how to create new php file name meso-custom-functions.php in wp-content/ ?
I want to create left sidebar in my website https://www.kebalilagi.com.
Looking forward to hearing back from you…
Regards,
Wayan
Very nice theme , i had recommended to all my fellow bloggers about it.
I had uploaded the “meso-custom-functions.php” file in /wp-content/ and the sidebar also come.
But when i add the widgets(any html text or tag cloud etc..) to it,then the widget added to left sidebar overlaps the right sidebar.
PLEASE HELP!!!!@go CricLive
are you using the latest version 1.6.4.1 and the updated file for adding left sidebar. go to author theme page and check the bottom faq section.if the above code doesn’t work, try this, it worked out for me:
<?php // add sidebar left function dez_add_sidebar_left() { ?> <div id="left-sidebar" class="sidebar"> <div class="sidebar-inner"> <div class="widget-area the-icons"> <?php if ( is_active_sidebar( 'left-sidebar' ) ) : ?> <?php dynamic_sidebar( 'left-sidebar' ); ?> <?php else: ?> <aside class="widget"> <h3 class="widget-title"><?php _e('Left Sidebar Widget', TEMPLATE_DOMAIN); ?></h3> <div class="textwidget"> <?php printf( __( 'This is a widget area for %1$s. You need to setup your widget item in <a href="%2$s">here</a>', TEMPLATE_DOMAIN ), 'left sidebar',admin_url('widgets.php') ); ?> </div> </aside> <?php endif; ?> </div> </div><!-- SIDEBAR-INNER END --> </div><!-- LEFT SIDEBAR END --> <?php } // add sidebar left style function dez_add_sidebar_left_style() { $main_color = get_theme_option('main_color'); $leftsidecolor = isset($main_color ) ? $main_color : '#52C0D4'; print "<style type='text/css' media='all'>"; ?> #custom #post-entry {float: right;width: 72%;} #custom #left-sidebar {padding:10px 0 0;float: left;width: 25%;} #left-sidebar .widget-area aside ul:first-of-type {width: 100%;padding: 0;} #left-sidebar .widget-area aside li a:hover {color:<?php echo $leftsidecolor; ?>;} #left-sidebar h3.widget-title {padding: 0% 0% 10px;font-size: 1.25em;margin: 0px 0px 0.5em;float: left;width: 100%;color: #333;text-transform: capitalize;border-bottom: 5px solid <?php echo $leftsidecolor; ?>;background:transparent none;border-radius:0;} <?php print "</style>"; } function dez_add_bpp_call() { global $in_bbpress, $bp_active; if( $in_bbpress == 'true' || ( $bp_active == 'true' && function_exists('bp_is_blog_page') && !bp_is_blog_page() ) ) { } else { add_action('bp_after_blog_home','dez_add_sidebar_left'); add_action('wp_head','dez_add_sidebar_left_style'); } } add_action('init','dez_add_bpp_call');
I hope this can be useful for someone.
- The topic ‘How to Add Left Sidebar?’ is closed to new replies.