adding a left sidebar to my theme
-
Alright, so im not a complete noob, i have done some research, but havent been able to get results.
Im trying to add another sidebar to the left side of my page, so that my posts align with my banner and the site looks more even.
ive made a sidebarleft.php and put
<div>
-
<?php if ( function_exists(‘dynamic_sidebar’) && dynamic_sidebar(2) ) : else : ?>
<?php endif; ?></div>
into it.
then I cant seem to get it all put togather with my index.php file.
I put the code right after the header and before the center div but i check my page after that and its all screwy.heres my index.php
<?php
get_header();
?><div align=”center”>
<div id=”content”>
<div id=”main”>
<div class=”top”></div>
<div id=”main_content”><?php if (is_category()) { ?>
<h2 class=”pagetitle”>'<?php echo single_cat_title(); ?>’ Category</h2>
<div id=”category-description”> <?php echo category_description(); ?> </div>
<?php } ?>
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
<div class=”post”>
<div class=”data”>
<?php the_time(‘F jS, Y’) ?>
</div>
<h3 class=”storytitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”<?php the_title(); ?>”>
<?php the_title(); ?>
</h3>
<div class=”autor”>
<?php the_category(‘, ‘) ?>
<?php edit_post_link(‘Edit’,’|’,”); ?>
</div>
<div class=”storycontent”>
<?php
if (is_category()) {
the_excerpt();
} else {
the_content(__(‘(more…)’));
} ?>
</div>
<div class=”feedback”>
<?php wp_link_pages(); ?>
<?php comments_popup_link(__(‘0 Comments’), __(‘1 Comments’), __(‘% Comments’)); ?>
</div>
<!–<?php trackback_rdf(); ?>–>
</div>
<?php comments_template(); // Get wp-comments.php template ?>
<?php endwhile; else: ?>
<p>
<?php _e(‘Sorry, no posts matched your criteria.’); ?>
</p>
<?php endif; ?>
<?php posts_nav_link(‘ — ‘, __(‘« Previous Page’), __(‘Next Page »’)); ?>
</div>
<div class=”bottom”></div>
</div>
<div id=”sidebar”>
<div class=”top”></div>
<?php get_sidebar(); ?>
<div id=”sidebar”><div class=”bottom”></div>
</div>
<?php get_footer(); ?>
</div>
</div>can anyone help, i always try for a really long time before i ask for help.
-
bump
You’re missing a closing DIV tag, and you’re also using the same ID for 2 divs…
ID’s can only be used once on the page…
You need classes or a seperate ID…
The topic ‘adding a left sidebar to my theme’ is closed to new replies.