Does it have a category.php?
<?php global $cat; ?>
<?php echo category_description( $cat ); ?>
If no category.php or archive.php in index.php
<?php if( is_category() ) : ?>
<?php global $cat; ?>
<?php echo category_description( $cat ); ?>
<?php endif; ?>
HTH
David
Thread Starter
Ry4nrc
(@ry4nrc)
Thank you so much that worked a treat.
I also added
<!-- category-title -->
<?php global $post; $category = get_the_category($post->ID); echo $category[0]->name; ?>
For the category title
I am trying to style the title and description now as it is very small, i have tried the “Allow HTML in description” plugin and similar ones but that does not work.
I am wanting the category title to be h1 and the text to be smaller, i have tried linking the new php line to a new class in my ccs file my cannot get it to work.
You are the man, hope you can help with this one. Thanks
Thread Starter
Ry4nrc
(@ry4nrc)
Oh yes you can see the size of the text Here right under the logo, and for anyone that is having problems with this, i added the code to the index.php
Just under
<?php global $query_string;
if (is_category()) query_posts($query_string . "&showposts=$post_number&paged=$paged&cat=$cat");
else query_posts($query_string . "&showposts=$post_number&paged=$paged"); ?>
Hi Rynrc,
Glad you have it sorted, mark this as resolved please.
I am wanting the category title to be h1 and the text to be smaller, i have tried linking the new php line to a new class in my ccs file my cannot get it to work
Have a look at how the current titles are rendered, and get_cat_name($cat), to style the title change the class name and copy and rename an existing style block to your class name.
<h1 class="cat-title">
<!-- category-title -->
<?php global $cat; echo get_cat_name( $cat ); ?>
</h1>
Style:
.entry h1.cat-title {
color: #757575;
font-size: 20px;
margin-bottom: 10px;
}
Note:
As it is a category the WordPress template heirarcy will find the first of category-{$slug}.php, category.php, archive.php and index.php so saving index.php as category.php and making the changes will mean you will not need the is_category() condition and maintain the index.php.
I recently enchanced the categories to use a custom posts for the description.
HTH
David
Thread Starter
Ry4nrc
(@ry4nrc)
Thank you David, all is well now.
Thanks for all the great help!