• Resolved gmgarrison

    (@gmgarrison)


    I’m trying to add a span tag to the title of the blog at thegarrisonshow.com but no matter what I do, it keeps displaying the tag instead of parsing it. Right now my header.php has the following:

    <head>
    	<meta charset="<?php bloginfo( 'charset' ); ?>" />
    	<meta name="viewport" content="width=device-width" />
    	<title>The <span id="garrison">Garrison</span> Show</title>
    	<link rel="profile" href="http://gmpg.org/xfn/11" />
    	<link rel="pingback" href="<?php bloginfo( 'pingback_url' ); ?>" />
    
    	<?php wp_head(); ?>
    </head>

    Am I missing something obvious?

Viewing 6 replies - 1 through 6 (of 6 total)
  • sacredpath

    (@sacredpath)

    Automattic Happiness Engineer

    Are you wanting the content of the span to be visible on your site?

    Thread Starter gmgarrison

    (@gmgarrison)

    I do – I want to be able to style the span separately in CSS but I can’t figure out how to get it parsed as HTML and not just displayed to the screen.

    I can’t find anything that indicates that HTML tags within the <title> tag should be parsed. What are you trying to achieve?

    Thread Starter gmgarrison

    (@gmgarrison)

    I’d like to style (change the color of, most specifically) one of the words inside my blog title. It seems like that’s got to be possible, right? I was thinking I could just wrap that word in a span tag and then apply a style to the span in CSS but I just get:
    The <span id=”accent”>Garrison</span> Show
    without the span tag actually being parsed.

    I think there may be some confusion in terminology. The <title> tag controls what’s displayed in the browser’s title (or tab) bar. If you’re trying to control how your site title is displayed on the page itself, make a child theme, copy sidebar-index.php from your parent theme to the child theme, and change this line (line 11):

    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home"><?php bloginfo( 'name' ); ?></a></h1>

    to

    <h1 class="site-title"><a href="<?php echo esc_url( home_url( '/' ) ); ?>" title="<?php echo esc_attr( get_bloginfo( 'name', 'display' ) ); ?>" rel="home">The <span class="garrison">Garrison</span> Show</a></h1>

    Thread Starter gmgarrison

    (@gmgarrison)

    Wow. Obviously. I knew I missing something huge.

    Thank you for the assistance!! Happy New Year!

Viewing 6 replies - 1 through 6 (of 6 total)

The topic ‘HTML in site title’ is closed to new replies.