description showing before enclosing tag
-
<?php global $post; // if outside the loop if ( is_front_page() ) { // This is the homepage echo '<h2 class="tagline">'.bloginfo('description').'</h2>'; } else { // This is a subpage echo '<p class="tagline">'.bloginfo('description').'</p>'; } ?>
I’m using this code in my header.php to show the blog description. The PHP basically puts the description in an h2 tag on the homepage and a p tag on subpages, for SEO. However, for some reason the actual description comes before the tag in the source.. I can’t figure out why. For example:
This is my description<h2 class="tagline"></h2>
- The topic ‘description showing before enclosing tag’ is closed to new replies.