i am working on wordpress single.php template this is my code:
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'content', get_post_format() ); ?>
<?php comments_template( '', true ); ?>
<?php endwhile; // end of the loop. ?>
This generates all of the post’s data, along with title, content, author and date information. The title of post is wraped in <h1>
tag, that I need to change into <h2>
tag. Any help?
This is what I am getting as a result of above code:
<article id="post-37" class="post-37 post type-post status-publish format-standard hentry category-home-intro">
<header class="entry-header">
<h1 class="entry-title">About Us</h1>
</header><!-- .entry-header -->
<div class="entry-content">
<p>Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis. Vivamus condimentum elementum arcu, ac fermentum lectus porttitor sed. Praesent ornare feugiat condimentum. Praesent sagittis metus id magna adipiscing convallis.</p>
</div><!-- .entry-content -->
<footer class="entry-meta">
This entry was posted in <a href="http://localhost/?cat=4" title="View all posts in Home Intro" rel="category">Home Intro</a> on <a href="http://localhost/?p=37" title="10:51 am" rel="bookmark"><time class="entry-date" datetime="2013-11-17T10:51:48+00:00">November 17, 2013</time></a><span class="by-author"> by <span class="author vcard"><a class="url fn n" href="http://localhost/?author=1" title="View all posts by Engr Zardari" rel="author">Engr Zardari</a></span></span>. </footer><!-- .entry-meta -->
</article>
You should look at content.php.
There you can change the HTML code corresponding to
get_template_part( 'content', get_post_format() );
.I don’t know why but changing
content-page.php
Helped me for changing h1 tags to h2 tags easily. Below is the code.