HTML Enclosing the_title() Not Writing
-
In a page, using a theme derived from TwentyTen and using onecolumn-page.php, the section that calls the_title() is not writing out the <h1> or <h2> tags that surround it.
I’ve apparently only customized the page by adding a check for whether the_title() even has content. That check is not returning false, because I get the title written out to the page – it’s just not enclosed in the heading tags as it should be.
I tried inserting the heading tags as $before and $after within the_title(), but then saw that the function applies strip_tags() to its output.
I can’t for the life of me figure out why the heading tags are not being written to the page:
<?php if ( the_title() != "" ): ?> <?php if ( is_front_page() ) { ?> <h2 class="entry-title"><?php the_title(); ?></h2> <?php } else { ?> <h1 class="entry-title"><?php the_title(); ?></h1> <?php } ?> <?php endif; ?>
Viewing 11 replies - 1 through 11 (of 11 total)
Viewing 11 replies - 1 through 11 (of 11 total)
- The topic ‘HTML Enclosing the_title() Not Writing’ is closed to new replies.