WordPress.org

Support

Support » How-To and Troubleshooting » if…else problem with meta description

if…else problem with meta description

Viewing 3 replies - 1 through 3 (of 3 total)
  • thisisedie
    Member

    @thisisedie

    Here ya go:

    <meta name="description" content="<?php if (is_home()) { echo ('site description'); }
    elseif (is_category('arts-ents')) { echo ('Test'); }
    elseif (is_category('ely-theatre-review')) { echo ('Your guide to AD'); }
    elseif (is_category('ely-music')) { echo ('The best of music in Cambridgeshire'); }
    elseif (is_tag()) { echo '-tag archive page for this blog' . single_tag_title(); }
    elseif (is_month()) { echo 'archive page for this blog' . the_time('F, Y'); }
    else { echo get_post_meta($post->ID, "Metadescription", true); } ?>">
    FionaGilbert
    Member

    @fionagilbert

    Fantastic! Thank you very much!

    thisisedie
    Member

    @thisisedie

    Your welcome 🙂

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘if…else problem with meta description’ is closed to new replies.