Support » Fixing WordPress » adding sidebar in My Favourite WordPress Theme

  • Hi everyone,

    I’ve been at it for 6 hours now and I’m growing tired :S
    I’ve got the My Favourite WordPress Theme installes on a testing section on my domein:

    Testing section

    This is the link to the original template:

    Original template

    As you might have seen I added an second sidebar on the original template. However I can’t seem to fix the code so everything is back in alignment :S

    This is what the css file looks like:

    CSS File

    This is what the function.php file looks like:

    <?php
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
    		'name' => '1',
            'before_widget' => '<div class="sidebar-box">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>',
        ));
    
    if ( function_exists('register_sidebar') )
        register_sidebar(array(
    		'name' => '2',
            'before_widget' => '<div class="sidebar2-box">',
            'after_widget' => '</div>',
            'before_title' => '<h3>',
            'after_title' => '</h3>',
        ));
    ?>

    This is what the index.php file looks like:

    <?php get_header(); ?>
    
    	<div>
    	<?php include (TEMPLATEPATH . '/left-sidebar.php'); ?>
    	</div>
    
    		<!-- Content -->
    
    		<div id="content">
    
    			<?php if (have_posts()) : ?>
    			<?php while (have_posts()) : the_post(); ?>
    			<!-- Post -->
    			<div class="post" id="post-<?php the_ID(); ?>">
    				<div class="post-title">
    					<h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></h2>
    					<div class="post-date"><?php the_time('d F') ?></div>
    				</div>
    				<div class="post-entry">
    					<?php the_content('Read more...'); ?>
    				</div>
    				<div class="post-info">
    					Posted by <?php the_author() ?> under <?php the_category(', ') ?> <span class="post-info-comments">| <a href="<?php the_permalink() ?>#respond">Comment now »</a> |</span>
    				</div>
    			</div>
    			<div class="clear"></div>
    			<!-- /Post -->
    			<?php endwhile; ?>
    			<!-- Navigation -->
    			<div class="navigation">
    				<div class="navigation-previous"><?php next_posts_link('« Previous Entries') ?></div>
    				<div class="navigation-next"><?php previou<em>s_posts_link('Next Entries »') ?></div>
    			</div>
    			<!-- /Navigation -->
    			<?php else : ?>
    			<!-- Post -->
    			<div class="post">
    				<div class="post-title">
    					<h2>Not Found</h2>
    				</div>
    				<div class="post-entry">
    					<p>Sorry, but you are looking for something that isn't here.</p>
    				</div>
    			</div>
    			<!-- /Post -->
    			<?php endif; ?>
    
    			<div class="clear"></div>
    
    		</div>
    		<!-- /Content -->
    
    <div>
    	<?php include (TEMPLATEPATH . '/right-sidebar.php'); ?>
    	</div>
    <?php get_footer(); ?>

    If the sidebar files are needed let me know 😉

    I cannot find out what I did wrong. For me it’s an prestige to even add a dynamic sidebar.
    If anyone has some tips or maybe the awnser I’m looking for, that is more then welcome.

    Thank you in advance!

  • The topic ‘adding sidebar in My Favourite WordPress Theme’ is closed to new replies.