Example #1
0
function get_tags_as_string($post_id)
{
    $tags = get_post_tags($post_id);
    //select the tags for a given post
    $s = '';
    //concatenate the tags
    for ($i = 0; $i < count($tags); $i++) {
        $s = $s . ',' . $tags[$i];
    }
    if (!empty($s)) {
        return substr($s, 1);
    } else {
        return FALSE;
    }
}
/**
 * add_meta_tags function.
 *
 * @access public
 * @return void
 */
function add_meta_tags()
{
    global $post;
    $options = get_theme_options();
    if (is_single()) {
        ?>
		<meta name="description" content="<?php 
        echo $post->post_excerpt;
        ?>
" />
		<meta name="revised" content="<?php 
        echo $post->post_modified_gmt;
        ?>
" />
		<meta name="author" content="<?php 
        echo get_author_complete_name($post->post_author);
        ?>
" />
		<meta name="keywords" content="<?php 
        echo get_post_tags($post->ID);
        ?>
" />
		<meta property="og:title" content="<?php 
        echo $post->post_title;
        ?>
" />
		<meta property="og:url" content="<?php 
        echo get_permalink($post->ID);
        ?>
" />
		<?php 
    } else {
        if (is_front_page()) {
            ?>
		<meta name="description" content="<?php 
            echo get_option('blogdescription', "Just another WordPress Blog.");
            ?>
" />
		<?php 
        } else {
            if (is_page()) {
            } else {
            }
        }
    }
    ?>
	<meta property="og:site_name" content="<?php 
    echo get_option('blogname');
    ?>
" />
	<meta property="og:type" content="blog" />
	<?php 
}