How to Show Only Post Titles on WordPress Archieve/Category Pages ( Easy Way for Novice User)

Posted by admin on Nov 14, 2009 in Hope for Better Blog | 1 comment

If you have a link on your wordpress blog sidebar to show all posts in the  category. But you don’t want the full posts to show: only the post TITLES. How did you do it? Is there an easy way for a novice user to configure category/archive pages to only display the post title of posts?

Most people will look for plugins to solve this problem, I myself have tried almost every wordpress category / archive plugins, but without success, I finally found after some trial error of a simple way to make it happen. Take a look at instruction below :

First of all you need to locate the file inside your theme folder that is managing the category or archives  pages. Most WordPress themes have that information inside the archive.php or category.php ( If they do not exist, you can make a copy of your theme  single page (single.php)  and name it category.php or archive.php).

Once you find the file you will need to find where the Loop starts, usually with the following line:

<?php while (have_posts()) : the_post(); ?>

The information contained inside the Loop will govern the structure of the posts inside the mentioned pages (categories, archives, so on).

Before change php

In order to display only the post titles  you will need to substitute that line (in red bracket in piture above) with the following:

<?php if ( in_category(‘wordpress’) ) { ?>

<a href=”<?php the_permalink(); ?>”><?php the_title(); ?></a>  <?php }; ?>

And if you want to make title have a smaller font and a bulleted list just add simple html code in following line :

after php

This simple tricks  works for me and gave the results I was looking for. It shows you don’t have to be a WordPress expert to make some nice customizations to your blog

Related posts:

  1. Beware of WordPress Plugin Vulnerabilities
  2. Problem with WordPress 2.9
  3. How to Hide Page Link at WordPress Blog

One Response to “How to Show Only Post Titles on WordPress Archieve/Category Pages ( Easy Way for Novice User)”

  1. Great article! Thank you a lot!

Leave a Reply

Improve the web with Nofollow Reciprocity.

Wordpress Seo Plugin