Return to Support

The description is missing in the head section of the page.

Home Forums Graphene WordPress theme Support The description is missing in the head section of the page.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #9944
    hilmil
    Participant

    HI all,

    I have been trying unsuccessfully to add a description (meta tag) to my home page. Bing Webmaster tools SEO Analyzer says, “The description is missing in the head section of the page.”

    I tried adding this to the Graphene advanced option allowing me to place code in the header.

    <?php if (  (is_home()) || (is_front_page())  ) { ?>
    <meta name="description" content="Health News and Reviews" />
    <?php } ?>

    I still get the same error from Bing SEO Analyzer. Is the code correct?

    Thanks!

    Hillary

    #44951

    You’re not saying what is supposed to happen if that if statement is true. You need an echo statement. Try:

    <?php if ( ( is_home() ) || ( is_front_page() ) ) {
    echo '<meta name="description" content="Health News and Reviews" />';
    } ?>

    Please put code in between backtick (

    Code:
    `

    ) characters. It’s usually located above the Tab key on your keyboard.

    I’ve fixed it for you in your post, but your original code may have been mangled by the parser. I think I have it correct, though.

    More info on php if... statement:

    http://www.w3schools.com/php/php_if_else.asp

    #44952
    hilmil
    Participant

    Thanks so much for that Kenneth!

Viewing 3 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.