Different Titles for different conditions
-
I’m not positive if this is the forum but I want to place different CSS styling on page and post titles. I’m not approaching it correctly so far:
<?php if (is_single()) { echo '<div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h2><?php the_title(); ?></h2><br /> <br />'; } else if(is_page()) { echo '<div <?php post_class() ?> id="post-<?php the_ID(); ?>"> <h1><?php the_title(); ?></h1><br /> <br />'; } ?>
This is within my index.php. I suspect there may be different solutions. I’m a novice. Any suggestions or feedback on what I’m doing wrong? As you can see I just changed the H tag above for a page and for a post. Thanks
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘Different Titles for different conditions’ is closed to new replies.