if statement writes out the title twice?!
-
hi, I wrote an if statement to change <h2> titles, this sort of works but writes out the titles twice?!
<?php if(the_title( '<h2>', '</h2>' ) == "Experience") {?> <?php echo '<h2>Profit from our experience</h2>'; ?> <?php } else { ?> <?php the_title( '<h2>', '</h2>' ); ?> <?php } ?> <?php the_content(); ?>
HTML output:
<h2>Building, Construction & Interiors</h2> <h2>Building, Construction & Interiors</h2>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘if statement writes out the title twice?!’ is closed to new replies.