Reputation: 445
I have the code below for a category in WordPress. It displays the name of the category when I want it to be displaying the title of the post. How do I get it to display the title of the post proper.
<? query_posts('category_name=implants');
?>
<h3><?php single_cat_title(); ?></h3>
<?php if (have_posts()) : while (have_posts()) :
the_post(); ?>
<?php the_content( __('Read the
rest of this page »', 'template')); ?>
<?php endwhile; endif; ?></p>
Upvotes: 0
Views: 194
Reputation: 11951
Here's what your revised loop should look like:
<?php
$query = new WP_Query('category_name=implants');
if($query->have_posts()) : while($query->have_posts()) : $query->the_post();
?>
<h3><?php the_title(); ?></h3>
<?php
the_content( __('Read the rest of this page »', 'template'));
endwhile; endif;
wp_reset_postdata();
?>
Upvotes: 2