meta description php code
-
I just recently added the following code to my header file to generate dynamic meta descriptions for my pages but it doesn’t seem to be working. Can anyone tell me if the code is correctly formatted?
<?php if ( is_home() ) { ?> <meta name="description" content="the meta description for my home page here" /> <?php } elseif ( is_single() ) { ?> <meta name="description" content="<?php the_excerpt();?>"/> <?php } ?>
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘meta description php code’ is closed to new replies.