• I have a movie website and im starting to use the tags-description to show som info about actors. I would like the tags-description and title only to show on the page if there is a tag-description written.

    I suppose i should do some if/else code but I dont know anything about that. The code I got now in my tag.php is

    <div id="tag-title"><?php single_tag_title(); ?></div>
    		<div id="tag-description"><?php echo tag_description(); ?></div>
    		<?php if ( is_tag() && tag_description() ) : ?>
    	<meta name="description" content="<?php echo wp_specialchars( strip_tags( tag_description() ), 1 ); ?>" />
    <?php endif; ?>

    Please help

    /Christian

    https://www.onyanserat.se

Viewing 15 replies - 16 through 30 (of 30 total)
Viewing 15 replies - 16 through 30 (of 30 total)
  • The topic ‘Help with If/else code’ is closed to new replies.