'')); if(strlen($seo_description) > 155){ $seo_description_split = explode(' ', substr($seo_description, 0, 150)); array_pop($seo_description_split); $seo_description = implode(' ', $seo_description_split).'...'; } return $seo_description; } //Yoast SEO not in use. Do our thing. add_action('wp_head', function(){ $site_name = get_bloginfo('name'); $site_url = home_url(); $q = get_queried_object(); $post_type = isset($q->post_type) ? $q->post_type : false; if(is_sircontheme_frontpage()){ $fbtype = 'website'; $twtype = 'summary'; $seo_description = get_bloginfo('description'); $seo_title = $seo_description; }else if($post_type){ //Is a post/page/customPostType $fbtype = 'article'; $twtype = 'summary'; $seo_title = $q->post_title; $seo_description = sircontheme_cleanup_seodescription($q->post_content); $seo_image = has_post_thumbnail($q->post_ID) ? get_the_post_thumbnail($q->post_ID) : ''; }else{ //Is archive? $fbtype = 'object'; $twtype = 'summary'; $seo_title = $q->name; $seo_description = false; /*$seo_title = $q->post_title; $seo_description = $q->post_content; $seo_image = has_post_thumbnail($q->post_ID) ? get_the_post_thumbnail($q->post_ID) : '';*/ } //FB echo "\n\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; echo ''."\n"; if($seo_description){ echo ''."\n\n"; } //Twitter if($twtype){ echo ''."\n"; } echo ''."\n"; echo ''."\n"; if($seo_description){ echo ''."\n"; } echo "\n"; }); ?>