<?php $my_query = new WP_Query( "cat=11&posts_per_page=1" );
if ( $my_query->have_posts() ) {
while ( $my_query->have_posts() ) {
$my_query->the_post();
the_excerpt();
}
}
wp_reset_postdata(); ?>
Where it says the_excerpt, how come I am unable to add other code alongside this? I'm guessing it's because it's still within the PHP tag, but I am unsure of how to seperate the two. Is there a way to make a section where the_excerpt is so that I may add additional code? I'm trying to add:
<h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
<div class="postdetails">
Written by <strong><?php the_author(); ?></strong>
<?php the_time ('j F, Y'); ?>
Posted in: <strong><?php the_category(', '); ?></strong>
<?php the_tags(); ?>
</div>
and THEN the excerpt
Thank you