{"id":3170,"date":"2014-11-25T12:53:40","date_gmt":"2014-11-25T03:53:40","guid":{"rendered":"http:\/\/blog.cgfm.jp\/garyu\/?p=3170"},"modified":"2017-09-06T10:50:35","modified_gmt":"2017-09-06T01:50:35","slug":"basercms%e3%81%a7twitter-card%e8%be%bc%e3%81%bf%e3%81%aeogp%e3%80%81meta%e3%82%bf%e3%82%b0%e3%82%92%e5%87%ba%e5%8a%9b%e3%81%99%e3%82%8b%e3%82%b3%e3%83%94%e3%83%9a","status":"publish","type":"post","link":"https:\/\/blog.cgfm.jp\/garyu\/archives\/3170","title":{"rendered":"baserCMS\u3067Twitter Card\u8fbc\u307f\u306eOGP\u3001Meta\u30bf\u30b0\u3092\u51fa\u529b\u3059\u308b\u30b3\u30d4\u30da"},"content":{"rendered":"<p>baserCMS\u3067\u30e1\u30c7\u30a3\u30a2\u30b5\u30a4\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3067\u305d\u306e\u6642\u306e\u30e1\u30e2\u3002<br \/>\nOGP\u30bf\u30b0\u306f\u666e\u901a\u306b\u4f7f\u3063\u3066\u307e\u3057\u305f\u304c\u3001<a href=\"https:\/\/dev.twitter.com\/ja\/cards\/overview\">Twitter\u30ab\u30fc\u30c9<\/a>\u306f\u4eca\u56de\u306e\u6848\u4ef6\u3067\u521d\u3081\u3066\u4f7f\u3044\u307e\u3057\u305f\u3002<\/p>\n<p>Twitter\u30ab\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u3066\u304a\u3051\u3070\u3001TL\u306b\u6d41\u308c\u305f\u6642\u306b\u30b5\u30e0\u30cd\u30a4\u30eb\u8868\u793a\u3055\u308c\u305f\u308a\u3001\u52d5\u753b\u57cb\u3081\u8fbc\u307f\u304c\u3067\u304d\u305f\u308a\u3057\u307e\u3059\u3002<br \/>\n\u307e\u305f\u30c4\u30a4\u30fc\u30c8\u57cb\u3081\u8fbc\u307f\u3067\u3082\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u304c\u8868\u793a\u3055\u308c\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<blockquote class=\"twitter-tweet\" lang=\"ja\"><p><a href=\"https:\/\/twitter.com\/hashtag\/FUKUOKA?src=hash\">#FUKUOKA<\/a> \u798f\u5ca1\u306e\u30af\u30ea\u30a8\u30a4\u30c6\u30a3\u30d6\u306a\u6700\u65b0\u30cb\u30e5\u30fc\u30b9 <a href=\"http:\/\/t.co\/RD8O9RxLaW\">http:\/\/t.co\/RD8O9RxLaW<\/a><\/p>\n<p>\u2014 \u6211\u6d41@MH4G_G\u7d1a2 (@Garyuten) <a href=\"https:\/\/twitter.com\/Garyuten\/status\/537092769454366721\">2014, 11\u6708 25<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<blockquote class=\"twitter-tweet\" lang=\"ja\"><p>\u79fb\u4f4f\u3057\u30662\u5e74 \u2026\u202628\u6b73\u5973\u6027\u304c\u8a9e\u308b\u300c\u798f\u5ca1\u3067\u50cd\u304f\u3068\u3044\u3046\u3053\u3068\u300d <a href=\"https:\/\/twitter.com\/hashtag\/FUKUOKA?src=hash\">#FUKUOKA<\/a> \u798f\u5ca1\u306e\u30af\u30ea\u30a8\u30a4\u30c6\u30a3\u30d6\u306a\u6700\u65b0\u30cb\u30e5\u30fc\u30b9 <a href=\"http:\/\/t.co\/odRzpaOJsI\">http:\/\/t.co\/odRzpaOJsI<\/a><\/p>\n<p>\u2014 \u6211\u6d41@MH4G_G\u7d1a2 (@Garyuten) <a href=\"https:\/\/twitter.com\/Garyuten\/status\/532773452424286208\">2014, 11\u6708 13<\/a><\/p><\/blockquote>\n<p><script async src=\"\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script><\/p>\n<p>\u4ee5\u4e0b\u306e\u4ed5\u69d8\u3067\u52d5\u4f5c\u3059\u308b\u306f\u305a\u3002<\/p>\n<ul>\n<li>Twitter Card\u306e\u30bf\u30a4\u30d7\u306f<strong><a href=\"https:\/\/dev.twitter.com\/cards\/types\/summary-large-image\">\u5927\u304d\u306a\u753b\u50cf\u4ed8\u304d\u306eSummary\u30ab\u30fc\u30c9<\/a><\/strong><\/li>\n<li>\u30d6\u30ed\u30b0\u306e\u8a18\u4e8b\u306e\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u3092\u8868\u793a<\/li>\n<li>\u30d6\u30ed\u30b0\u4ee5\u5916\u306e\u56fa\u5b9a\u30da\u30fc\u30b8\u3001HOME\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u753b\u50cf\u3092\u5225\u9014\u6307\u5b9a<\/li>\n<\/ul>\n<p>\u5bfe\u8c61\u30d5\u30a1\u30a4\u30eb\u300c \/theme\/{\u30c6\u30fc\u30de\u540d}\/Layouts\/default.php \u300d\u306ehead\u30bf\u30b0\u5185\u306b\u4ee5\u4e0b\u306e\u30b3\u30fc\u30c9\u3092\u30b3\u30d4\u30da\u3057\u3066\u4e00\u90e8\u8a2d\u5b9a\u3092\u66f8\u304d\u63db\u3048\u308c\u307b\u307c\u52d5\u304f\u306f\u305a\u3002<\/p>\n<pre><code class=\"php\">\n<?php\n\/\/OGP\n\/\/=====================================\n$siteName = $siteConfig[\"name\"];\n$siteUrl = $siteConfig[\"name\"];\n$description = mb_substr( $siteConfig[\"description\"] ,0, 297); \/\/\u30b5\u30a4\u30c8\u306e\u8aac\u660e\u6587297\u6587\u5b57\u4ee5\u5185\n$title = $this->BcBaser->getTitle(); \/\/\u30da\u30fc\u30b8\u30bf\u30a4\u30c8\u30eb95\u6587\u5b57\u4ee5\u5185\n$type =\"website\"; \/\/\u8a18\u4e8b\u306farticle, \u305d\u308c\u4ee5\u5916(HOME\u3001\u56fa\u5b9a\u30da\u30fc\u30b8\uff09\u306fwebsite\n$url =$this->BcBaser->getUri($this->BcBaser->getHere());\n \n$publisher = \"https:\/\/www.facebook.com\/Toru.Kaneuchi\"; \/\/\u8457\u8005\u306eFacebook\u30da\u30fc\u30b8URL\u304bID\u3002Facebook\u30da\u30fc\u30b8\u306eFollow\u30dc\u30bf\u30f3\u3092\u8868\u793a\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308b\u3002\n$fb_id = \"*************\";       \/\/Facebook\u306eAPP ID\n$author = \"@Garyuten\";      \/\/Twitter Card\u306b\u8868\u793a\u3055\u308c\u308b\u30a2\u30ab\u30a6\u30f3\u30c8\u540d\n$domain = \"blog.cgfm.jp\";       \/\/Twitter Card\u306b\u8868\u793a\u3055\u308c\u308b\u30c9\u30e1\u30a4\u30f3\u540d\n \n$eyeCatch = \"http:\/\/hoge.com\/images\/ogp.png\"; \/\/\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u753b\u50cf\u3092\u30d5\u30eb\u30d1\u30b9\u6307\u5b9a\uff08\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u304c\u7121\u3044\u5834\u5408\uff09\n \n\/\/\u30d6\u30ed\u30b0\u8a18\u4e8b\u306e\u5834\u5408\u306f\u30a2\u30a4\u30ad\u30e3\u30c3\u30c1\u753b\u50cf\u3092\u51fa\u529b\nif (!empty($post)) {\n    $type =\"article\";\n    $num = 297; \/\/\u8aac\u660e\u6587\u306e\u6587\u5b57\u6570\u5236\u9650\uff08\u672c\u6587\u304b\u3089\u629c\u304d\u51fa\u3057\uff09\n    $str = strip_tags($post[\u2018BlogPost\u2019][\u2018detail\u2019]); \/\/\u30bf\u30b0\u9664\u53bb\n    $str = str_replace(array(\"\\r\\n\",\"\\n\",\"\\r\"), \u201d, $str); \/\/\u6539\u884c\u9664\u53bb\n    if(mb_strlen($str) >= $num) {\n        $description = mb_substr($str, 0,$num-1).\"\u2026\";\n    } else {\n        $description = $str;\n    }\n \n    \/\/\u30bf\u30a4\u30c8\u30eb\u306b\u306f\u30b5\u30a4\u30c8\u30bf\u30a4\u30c8\u30eb\u3092\u542b\u3081\u306a\u3044\n    $title = $this->Blog->getPostTitle($post,false).\" \u2013 \".$siteConfig[\"formal_name\"]; \/\/\u30da\u30fc\u30b8\u30bf\u30a4\u30c8\u30eb95\u6587\u5b57\u4ee5\u5185\n \n    $blogName = $post[\"BlogContent\"][\"name\"];\n    $baseCurrentUrl = \"\/\".$blogName . \u2018\/archives\/\u2019;\n    $baseCurrentImgUrl = \"\/files\/blog\/\".$blogName . \"\/blog_posts\/\";\n    $eyeCatch = $this->BcBaser->getUri( $baseCurrentImgUrl . $post[\"BlogPost\"][\"eye_catch\"]);\n}\n?>\n  <meta property=\"article:publisher\" content=\"<?php echo $publisher; ?>\">\n  <meta property=\"og:type\" content=\"<?php echo $type; ?>\">\n  <meta property=\"og:locale\" content=\"ja_JP\">\n  <meta property=\"og:site_name\" content=\"<?php echo $siteName; ?>\">\n  <meta property=\"og:title\" content=\"<?php echo $title; ?>\">\n  <meta property=\"og:description\" content=\"<?php echo $description; ?>\">\n  <meta property=\"og:url\" content=\"<?php echo $url; ?>\">\n  <meta property=\"og:image\" content=\"<?php echo $eyeCatch; ?>\">\n  <meta property=\"fb:app_id\" content=\"<?php echo $fb_id; ?>\">\n  <?php \/\/ Twitter Cards\u306e\u7a2e\u985e\u6307\u5b9a ?>\n  <meta name=\"twitter:card\" content=\"summary_large_image\">\n  <?php \/\/ \u5199\u771f\u5de6\u4e0a \uff1a\u300c\u30a2\u30ab\u30a6\u30f3\u30c8\u540d\u300d\u306e\u8868\u8a18\uff08\u7121\u304f\u3066\u3082OK\uff09 ?>\n  <meta name=\"twitter:site\" content=\"<?php echo $author; ?>\">\n  <?php \/\/ by (\u6295\u7a3f\u8005) \uff1a\u5199\u771f\u4e0b\u306e \u300cBy \u30a2\u30ab\u30a6\u30f3\u30c8\u540d @TwitterID \u300d\uff08\u7121\u304f\u3066\u3082OK\uff09?>\n  <meta name=\"twitter:creator\" content=\"<?php echo $author; ?>\">\n  <meta name=\"twitter:domain\" content=\"<?php echo $domain; ?>\">\n  <meta name=\"twitter:url\" content=\"<?php echo $url; ?>\">\n  <meta name=\"twitter:title\" content=\"<?php echo $title; ?>\">\n  <meta name=\"twitter:description\" content=\"<?php echo $description; ?>\">\n  <meta name=\"twitter:image\" content=\"<?php echo $eyeCatch; ?>\">\n<\/code><\/pre>\n<p>\u8ab0\u304bhelper\u4f5c\u3063\u3066\u2661<\/p>\n","protected":false},"excerpt":{"rendered":"<p>baserCMS\u3067\u30e1\u30c7\u30a3\u30a2\u30b5\u30a4\u30c8\u3092\u69cb\u7bc9\u3059\u308b\u3053\u3068\u304c\u3042\u3063\u305f\u306e\u3067\u305d\u306e\u6642\u306e\u30e1\u30e2\u3002 OGP\u30bf\u30b0\u306f\u666e\u901a\u306b\u4f7f\u3063\u3066\u307e\u3057\u305f\u304c\u3001Twitter\u30ab\u30fc\u30c9\u306f\u4eca\u56de\u306e\u6848\u4ef6\u3067\u521d\u3081\u3066\u4f7f\u3044\u307e\u3057\u305f\u3002 Twitter\u30ab\u30fc\u30c9\u3092\u6307\u5b9a\u3057\u3066\u304a\u3051\u3070\u3001TL\u306b\u6d41\u308c\u305f\u6642\u306b\u30b5\u30e0 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"swell_btn_cv_data":"","footnotes":""},"categories":[311,18],"tags":[376,324,355,12,244,9,86],"class_list":["post-3170","post","type-post","status-publish","format-standard","hentry","category-basercms","category-php","tag-basercms","tag-facebook","tag-ogp","tag-seo","tag-twitter","tag-memo","tag-86"],"_links":{"self":[{"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/posts\/3170","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/comments?post=3170"}],"version-history":[{"count":16,"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/posts\/3170\/revisions"}],"predecessor-version":[{"id":3596,"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/posts\/3170\/revisions\/3596"}],"wp:attachment":[{"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/media?parent=3170"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/categories?post=3170"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.cgfm.jp\/garyu\/wp-json\/wp\/v2\/tags?post=3170"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}