WordPress.org

Ready to get started?Download WordPress

Forums

Display different logo if current page isn't the homepage? (2 posts)

  1. rubbed
    Member
    Posted 2 years ago #

    I display my site title in an H1 tag on my homepage.

    In my other pages I would like to display this same title in a paragraph tag and not a H1 tag, so I can make better use of a single H1 elsewhere in the page (trying to limit 1 h1 per page for seo).

    Is this possible?

  2. alchymyth
    The Sweeper & Moderator
    Posted 2 years ago #

    look into header.php of Twenty Ten for some example code:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    				<<?php echo $heading_tag; ?> id="site-title">
    					<span>
    						<a href="<?php echo home_url( '/' ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a>
    					</span>
    				</<?php echo $heading_tag; ?>>

    if you have problems adapting it to be used in your theme, please post here again.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.