• Resolved indietrash

    (@indietrash)


    hi. on my sidebar I display categories and archives. how can I make the categories and archives display the number of posts in each category/archive as well as their respective names? e.g. a category named “folk punk” with 20 posts would show as “folk punk (20)”.

    I’ve included the whole sidebar code below:

    <!-- begin sidebar -->
    <div id="sidebar">
    <form id="searchform" method="get" action="<?php echo $_SERVER['PHP_SELF']; ?>">
    			<div>
    				<input type="text" name="s" value="search for..." id="s" size="15" onclick="value=''" onblur="value='search for...'" /><br />
    				<? /*<input type="submit" value="<?php _e('Search'); ?>" />*/?>
    			</div>
    		</form>
    
    <ul>
    <?php 	/* Widgetized sidebar */
    		if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar() ) : ?>
    
    	<?php wp_list_pages(); ?>
    	<li id="categories"><?php _e('categories:'); ?>
    		<ul>
    			<?php wp_list_cats(); ?>
    		</ul>
     	</li>
    
    	<li id="archives"><?php _e('archives:'); ?>
     		<ul>
    	 		<?php wp_get_archives('type=monthly'); ?>
     		</ul>
     	</li>
     	<li id="feeds"><?php _e('feeds'); ?>
     		<ul>
    			<li><a href="feed:<?php bloginfo('rss2_url'); ?>" title="<?php _e('Syndicate this site using RSS'); ?>"><?php _e('<abbr title="Really Simple Syndication">RSS</abbr> Contents'); ?></a></li>
    <br />
    
     <?php endif; ?>
    </ul>
    </div>
    <!-- end sidebar -->
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘how can I show #posts on my sidebar?’ is closed to new replies.