Forums

need help with php if/else (3 posts)

  1. rawwebdesign
    Member
    Posted 1 year ago #

    Hi,

    With some help from all of you wonderful forum posters, I've come up with this for my header's meta-description:

    <?php if( is_home() ) : ?>
    <meta name="description" content="Web Design, Web Development, and Search Engine Optimization in Columbus, Ohio" />
    
    <?php else : ?>
    <meta name="description" content="<?php the_excerpt() ?>" />
    
    <?php endif; ?>

    Now that I'm adding Ultimate Tag Warrior, I wanted to insert another condition that I thought would look like this:

    <?php if( is_home() ) : ?>
    <meta name="description" content="Web Design, Web Development, and Search Engine Optimization in Columbus, Ohio" />
    
    <?php if( is_tag() ) : ?>
    <meta name="description" content="You are now checking out all posts about <?php UTW_ShowCurrentTagSet('tagsetcommalist') ?>" />
    
    <?php else : ?>
    <meta name="description" content="<?php the_excerpt() ?>" />
    
    <?php endif; ?>

    But the whole site just breaks when I put that in... what am I missing?

    Thanks soooo much to anyone who can help...

    Brad

  2. lexhair
    Member
    Posted 1 year ago #

    Try elseif( is_tag())

  3. rawwebdesign
    Member
    Posted 1 year ago #

    lexhair,

    that works so perfectly. thanks a bundle.

    -brad

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags