• Hey Y’all,
    How can I add an <h1> tag for my site ?

    I understand that this will have to be done through a function variable, something that could include this:

    $tag = (is_home() || is_front_page()) ? ‘h1’ : ‘div’;

    However, it’s a bit over my head, could someone help me as to what to put in the header and what in the functions.php?

    Thanks you I really appreciate it!

    Naomi

Viewing 3 replies - 1 through 3 (of 3 total)
  • what is the point of that, if you have only an image and no text in the title?

    if you insist, look into Twenty Ten header.php for a full example.

    Thread Starter naomi1

    (@naomi1)

    For SEO purposes, you can have an ALT tag on the image. The huffington post does just that:

    <h1>
    						<a href="">
                                                                                                            <img src="https://s.huffpost.com/images/v/logos/v4/homepage.gif?v8" alt="The Huffington Post" />
    
    <!--
    
    -->
    		<br/>
    				<img src="https://s.huffpost.com/images/v/logos/v4/tagline.gif" width="460" height="9" class="margin_top_5" alt="The Huffington Post" />
    		<!--
    
    -->						</a>
    					</h1>

    this is basically using the code from header.php of Twenty Ten, and entering your image code (copied from the html of your linked page in the browser) in the middle:

    <?php $heading_tag = ( is_home() || is_front_page() ) ? 'h1' : 'div'; ?>
    <<?php echo $heading_tag; ?> id="site-title" class="clear-block"><center>
    		<a href="https://www.get-into-medicalschool.com">
                                                                                             <img src="/images/gim.jpg" alt="How to Get Into Medical School" />
                                                        				</a>					
    
    </center>
    </<?php echo $heading_tag; ?>>

    you might need to get the exact code between the center tags from header.php of your theme.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘H1 Tag for Logo only on Home Site’ is closed to new replies.