Automatic filling of the description meta tag on wordpress head
Use this code snippet to automate the filling of the description metatag under the wordpress engine. On the home page, the general settings page description will be taken from the code.
<meta name=”description” content=”<?php if ( is_front_page() || is_archive()||is_home() ) {?><?php bloginfo('description'); ?><?php } ?><?php if (have_posts() && is_single() OR is_page()):while(have_posts()):the_post();$out_excerpt = str_replace(array(“\r\n”, “\r”, “\n”), “”, get_the_excerpt());echo apply_filters('the_excerpt_rss', $out_excerpt);endwhile; endif; ?>” />