Hi,

Many wordpress users wants to display Category Pages instead of Post titles. For that you need to perform these steps:

1) Open archive.php file of your theme.
2) Remove the code between the loops.

Loop starts at:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>

Loop End:
<?php endif; ?>

3) Add this code between the  loop:
<?php $temp_category = single_cat_title(”,false); if (!empty($temp_category)){ //
give index ?>
<h1><?php single_cat_title(); ?></h1>
<p><?php echo(category_description(the_category_ID(false))); ?></p>
<?php if ($posts) : foreach ($posts as $post) : start_wp(); ?>
<li><a href=”<?php the_permalink() ?>”><?php the_title(); ?></a></li><br>
<?php endforeach; else: ?>
<p><?php _e(‘Sorry, no posts matched your criteria.’); ?></p>
<?php endif; ?>
<?php }else{ // give details or single post ?>
…… code for normal post overview
<?php } ?>

4) Save and upload the file again on the server.

That’s it!

Thanks,

Shane G.

Popularity: 1%

Related posts:
  1. How To Display Image In Category And Archive Pages Of WordPress Blog? Hello All, It is possible to display images in category...
  2. How To Change Post Category in WordPress Blog? Hello All, In order to change the posted post category...
  3. Database Query To Add Post In A Category In WordPress Blog? Hi, Please use this code to add post in a...
  4. How To Set Default Post Category In WordPress Blog? Hi, When you post at your blog and forget to...
  5. Code To Count Total Number Of Post For A Category In WordPress Blog Hi, We can use below mentioned function to display total...

Leave a Reply

You must be logged in to post a comment.