Support » Fixing WordPress » custom sidebar not working properly

  • I am trying to create multiple custom sidebars, and I’ve gotten them created. and Some info is displaying but when I try and add something such as :

    <?php get_posts('numberposts=10'); ?>

    It doesn’t seem to work.

    This is my index.php file:

    <?php get_header(); ?>
    
    	</div>
    
    	<?php include ('sidebar-main.php'); ?>
    
    	<?php include (TEMPLATEPATH . '/sidebar.php'); ?>
    
    		<div id="box">
    
    		<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
    
    				<div class="post">
    
    				<h1><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
    				<div class="entry">
    
    				<?php the_content(); ?>
    
    				<p class="postmetadata">
    				<?php _e('Filed under:'); ?> <?php the_category(', ') ?> <?php _e('by'); ?> <?php  the_author(); ?><br />
    				<?php comments_popup_link('No Comments »', '1 Comment »', '% Comments »'); ?> <?php edit_post_link('Edit', ' | ', ''); ?>
    								</p>
    
    				</div>
    
    				</div>
    
    		<?php endwhile; ?>
    		<div class="navigation">
    		<?php posts_nav_link(); ?>
    
    		</div>
    
    		<?php endif; ?>
    		</div>
    
    <?php get_footer(); ?>	
    
    </body>
    
    </html>

    and the sidebar in question:

    <div class="sidebar-main">
    
    		<h2>Navigate</h2>
    		<ul>
    		<li><a <?php if (is_home()) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>">home</a></li>
    		<li><a <?php if (is_page('about')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/blog/about/">about</a></li>
    		<li><a class="smcf-link" <?php if (is_page('archives')) echo('class="current" '); ?>href="<?php bloginfo('url'); ?>/blog/archive/">archives</a></li>
    		</ul>
    
    		<h2>connect</h2>
    		<ul>
    		<li><a href="#">twitter</a></li>
    		<li><a href="#">facebook</a></li>
    		<li><a href="#">youtube</a></li>
    		<li><a href="#">delicous</a></li>
    		</ul>
    
    		<h2>recent</h2>
    		<?php get_posts('numberposts=10'); ?>
    
    	</div>

    The site is at http://sketchcraft.com/

    Any help is greatly appreciated.
    Thanks

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘custom sidebar not working properly’ is closed to new replies.