Support » Plugin: Easy WP Meta Description » Use conditionally

  • Resolved gulliver

    (@gulliver)


    I’ve been using…

    
    <meta name="description" content="<?php echo strip_tags(get_the_excerpt());?>">
    

    And it works ok for pages, but for posts is unsuitable because I use ‘the excerpt’ as teasers for feeds and so a meta description which uses the excerpt isn’t ideal.

    Can this be used with a conditional statement to apply only to posts and not pages, with something like…

    
    <meta name="description" content="<?php
    if ( is_single() ) { WHAT DO I ADD HERE? }
    else { echo strip_tags(get_the_excerpt()); }
    ?>" />
    
Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Mats Westholm

    (@matswes)

    If you use the plugin you dont need to add any code in your files

    @matswes… Thanks.

    As it was awhile ago when I posted the question, and my memory isn’t as good as I’d like, I’m not sure just what I was trying to do – so please consider this resolved.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Use conditionally’ is closed to new replies.