Forums
-
- Forum
- Posts
-
- Installation
- 28,536
- Troubleshooting
- 62,801
- Themes
- 10,444
- Plugins
- 15,389
- Requests & Feedback
- 14,986
- Showcase
- 3,257
-
Thanks all, got it working with this:
if ( $posts ) {
$out = $posts[0]->post_text;
$out = strip_tags( $out );
$out = str_replace( array( "n", "r" ), ' ', $out );
$out = preg_replace( '|/!]*?[^[*?]|si', '', $out );
$out = substr($out, 0, 200); // only display the first 200 characters of the first post
}
echo "n".'<meta name="description" content="'.$out.'" />';