function custom_meta_tags() { global $post; $content = get_bloginfo('description'); // if not front page, use excerpt from content if (!is_front_page() && $post) { $excerpt = $post->post_excerpt ? $post->post_excerpt : H_Elper::trim_content($post->post_content); $content = $excerpt ? $excerpt : $content; } echo "<meta name='description' content='{$content}'>"; }