Automatic Excerpt is Not Working
-
Hello,
I am trying to use the post excerpt for meta description, like this:<?php if ( is_single() ) { ?> <meta name="description" content="<?php echo get_the_excerpt() ?>" /> <?php } ?>
It is working just fine for posts which have an excerpt added. But it is empty for posts which do not have an excerpt.
Why?
http://codex.wordpress.org/Function_Reference/the_excerpt
This page says that “If you do not provide an explicit excerpt to a post (in the post editor’s optional excerpt field), it will display an automatic excerpt which refers to the first 55 words of the post’s content.”
Any ideas?
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Automatic Excerpt is Not Working’ is closed to new replies.