<?php if (is_single()) : if (have_posts() ) : while (have_posts() ) : the_post(); ?>
<meta name="description" content="<?php $tags = the_tags([
'number' => 4,
'orderby' => 'rand',
] );
if( $tags) :
foreach( $tags as $tag ) {
echo $tag->name . '. ';
}
endif; ?>"/>
<?php endwhile; endif; elseif (is_front_page()): ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>
<?php if (is_single()) : if (have_posts() ) : while (have_posts() ) : the_post(); ?>
<meta name="description" content="<?php $tags = the_tags([
'number' => 4,
'orderby' => 'rand',
] );
if( $tags) :
foreach( $tags as $tag ) {
echo $tag->name . '. ';
}
endif; ?>"/>
<?php endwhile; endif; elseif (is_front_page()): ?>
<meta name="description" content="<?php bloginfo('description'); ?>" />
<?php endif; ?>