Trying to add a left sidebar to a 2-column bp theme
-
Hello
I am currently trying to add a left sidebar to the “randy-candy” buddypress childtheme.
I am very inexperienced in css and xhtml. So far by searching other threads and copy pasting some text i have added a second widget area however it is located in the bottom left area of my footer.
this is what i have done so far:
added this to index.php:
<?php locate_template( array( ‘sidebar-left.php’ ), true ) ?>
created sidebar-left.php:
<div id=”sidebar-left” class=”bpside”>
<?php if ( !function_exists(‘dynamic_sidebar’)
|| !dynamic_sidebar(‘sidebar-left’) ) : ?>
<div id=”text” class=”widget widget_text”>
<h3 class=”widgettitle”><?php _e(‘Sidebar Widget’); ?></h3>
<div class=”textwidget”>
<?php _e( ‘Please log in and add widgets to this sidebar.’, ‘buddypress’ ) ?>
/wp-admin/widgets.php?s=&show=&sidebar=sidebar-left”><?php _e( ‘Add Widgets’, ‘buddypress’ ) ?>
</div>
</div>
<?php endif; ?>added this to function.php:
<?php
/* Register the widget columns */
register_sidebar(
array(
‘name’ => __(‘Sidebar’),
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”widgettitle”>’,
‘after_title’ => ‘</h3>’
)
);register_sidebar(
array(
‘name’ => __(‘Sidebar-left’),
‘before_widget’ => ‘<div id=”%1$s” class=”widget %2$s”>’,
‘after_widget’ => ‘</div>’,
‘before_title’ => ‘<h3 class=”widgettitle”>’,
‘after_title’ => ‘</h3>’
)
);?>
made this change to the css file in the childtheme:
div#content .padder {
margin-left: 226px;
border-right: 1px solid #e4e4e4;
-moz-border-radius-topleft: 3px;
-webkit-border-top-left-radius: 3px;
-moz-border-radius-bottomleft: 3px;
-webkit-border-bottom-left-radius: 3px;
}this has created the space where i want the sidebar to be but i am not sure how to position the sidebar in this space. I tried copying the sidebar code from the bp default theme and just reversing everything but that did not produce the desired result.
I think im in alittle over my head here but feel like im so close to making it work! the website in question is https://wouldyouhit.it
the changes ive made are live on the site right now but i may change it back to the basic randy candy theme.
- The topic ‘Trying to add a left sidebar to a 2-column bp theme’ is closed to new replies.