Loop – first header tag
-
I only want the first header tag in the following code to be H1 and the following tags to be H2, I used to know how to do this, but I’ve complete forgotten. Can anyone point me in the right direction?
Thank you
<?php $args = array( 'post_type' => 'discussion', 'posts_per_page' => 1 ); $loop = new WP_Query( $args ); while ( $loop->have_posts() ) : $loop->the_post(); echo '<div class="headline-discussion">'; ?> <?php echo '<div class="headdisc-image">'; if ( has_post_thumbnail() ) { // check if the post has a Post Thumbnail assigned to it. the_post_thumbnail(); } echo '</div>'; ?> <div class="post"> <h1 class="toptitle"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1> <div class="entry"> <?php the_excerpt(); ?> </div> </div> </div> <?php endwhile; ?>
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Loop – first header tag’ is closed to new replies.