Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I would like to use this script (found here), but it generates a blank page when I add it to my header.php

     if ( is_home() ) { ?>
    <meta name="description" content="Your home page meta description" />
<?php } else {  ?>  <meta name="description" content="Your none homepage meta description" /> 
<?php } ?> 

Thank's!

share|improve this question
1  
Please add debug information to your question to make answers possible. –  toscho Mar 25 '13 at 15:37
    
You are using an opening PHP tag, right? That is <?php if ( is_home() ) etc –  vancoder Mar 25 '13 at 17:14
    
Ok, yes indeed I forgot <? php! But I thought this script was the description that on the home page, off it appears on all pages. How can make for the description is displayed right on the home page? Thank's –  gwen Mar 26 '13 at 7:44
add comment

1 Answer

I just tried it with this code and it all worked as it should:

<?php if ( is_home() ) : ?>
    <meta name="description" content="Your home page meta description" />
<?php else : ?>
    <meta name="description" content="Your non-homepage meta description" />
<?php endif; ?>

You want to be sure there's not a space between <? and php (<?php).

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.