'1085088865' ); if (is_front_page()) { // Landing page $title = get_bloginfo('name'); $description = get_bloginfo('description'); $type = 'website'; } elseif (is_home()) { // Blog "page" $title = get_bloginfo('name'); $description = "A collection of all " . get_bloginfo('name') . " blog posts."; $type = 'website'; $url = get_home_url(null, '/blog/'); } elseif (is_post_type_archive()) { // custom post type archive "page" $post_type = get_post_type(); $post_type_archive_url = get_post_type_archive_link($post_type); $type = 'website'; $title = post_type_archive_title('', false); $post_type_obj = get_post_type_object($post_type); if (isset($post_type_obj->description)) $description = $post_type_obj->description; if (!empty($post_type_archive_url)) $url = $post_type_archive_url; } elseif (is_archive()) { // archives and category "pages" $type = 'website'; $title = get_bloginfo('name')." Blog ".get_the_archive_title(); $description = "A collection of " . get_bloginfo('name') . " blog posts."; if (is_category()) { $category_objects = get_the_category(); if (isset($category_objects[0]->term_id)) $url = get_category_link($category_objects[0]->term_id); } } elseif (is_single() || is_page()) { // Posts and Pages $post = get_post(); $social_image_url = get_post_meta(get_the_ID(), 'og-image-url', true); if (!empty($social_image_url)) { $image_url = $social_image_url; } elseif (has_post_thumbnail()) { $image_src = wp_get_attachment_image_src(get_post_thumbnail_id($post_id), 'large'); if (isset($image_src[0])) $image_url = $image_src[0]; } elseif (is_single()) { preg_match_all('//i', $post->post_content, $matches); if (isset($matches[2][0])) $image_url = $matches[2][0]; } $categories = wp_get_object_terms(get_the_ID(), 'category', array('fields' => 'names')); $tags = wp_get_object_terms(get_the_ID(), 'post_tag', array('fields' => 'names')); // Post author data is not available in wp_head filter context $twitter_handle = get_the_author_meta('twitter', $post->post_author); $published_time = get_the_time('c'); $modified_time = get_the_modified_date('c'); } if ($image_url[0] === '/') $image_url = get_home_url(null, $image_url); ?>