Wordpress and Webdesign Forum go41 » WordPress Code Snippets

  1. To display the category bar of Arthemia WordPress Theme free version on all pages you can try this:

    At the end of header.php the last line should be: <div id="page" class="clearfloat">

    below this put:

    <?php /* If this is not home because index.php shows this */ if ( !is_home() || is_paged() ) { ?>
    	<div id="middle" class="clearfloat">
    	<img src="<?php echo get_option('home'); ?>/wp-content/themes/arthemia/images/category.png" class="clearfloat" alt="" />
    	<?php $display_categories = array(5,6,7,8,11); $i = 1;
    	foreach ($display_categories as $category) { ?>
    
    	<div id="cat-<?php echo $i; ?>" class="category">
    		<?php query_posts("showposts=1&cat=$category")?>
    		<span class="cat_title"><a href="<?php echo get_category_link($category);?>"><?php single_cat_title(); ?></a></span>
    		<a href="<?php echo get_category_link($category);?>"><?php echo category_description($category); ?></a>
    	</div>
    
    	<?php $i++; ?>
        	<?php } ?>
    <?php wp_reset_query(); ?>
    	</div>
    <?php } //end categories not on home ?>

    This will display category bar just below header in case you are not on first page in index.php.

    You could also exclude other views in the first line of this code:

    <?php /* If this is not home because index.php shows this */ if ( (!is_home() || is_paged()) && !is_page() ) { ?>

    Use above to exclude the category bar from sowing on pages

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.

Join us! or log in (lost password?):