What you’re describing is a category list – controlled by your theme’s category.php template file. If your theme doesn’t have a category.php file, then it will be using archive.php or index.php (in that order).
I don’t have a category.php or archive.php, I am using the iBlog2 theme, my blog is http://itracki.com. Please help!!
Then copy that theme’s index.php to category.php and delete the code you don’t want to display–for instance you would delete this so the post content would not display:
<?php the_content(__('Continue reading »',TDOMAIN)); ?>
Also review:
Stepping Into Template Tags
Stepping Into Templates
Template Hierarchy
Thanks for the quick reply, MichaelH.
So what you’re saying is that I have to create a template called category.php?
Maybe I didn’t make myself clear, but what I actually wanted is to have the post titles of all the posts in a category to be displayed ON A PAGE THAT I CREATED using WordPress. How is this done?
Thanks, please reply!
Put this in your Page Template
<?php
$cat_id = 3; //change to your category ID
$args=array(
'cat' => $cat_id,
'post_type' => 'post',
'post_status' => 'publish',
'posts_per_page' => -1,
'caller_get_posts'=> 1
);
$my_query = null;
$my_query = new WP_Query($args);
if( $my_query->have_posts() ) {
echo 'List of Posts';
while ($my_query->have_posts()) : $my_query->the_post(); ?>
<p><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent Link to <?php the_title_attribute(); ?>"><?php the_title(); ?></a></p>
<?php
endwhile;
}
wp_reset_query(); // Restore global post data stomped by the_post().
?>
MichaelH, I tested your solution and it works, but the problem is that you have to put the code in the Page Template (page.php). What I need is to put it into a page. For example, I created a page called “List of posts in category uncategorized.” I then need to put code in my post that would read out all the posts in this category, and put them into the page. I am not doing anything whatsoever with the template.
Could you please help?
Thanks!!