From 1afa455f98bb1250d0ce194216be19b409fb52e3 Mon Sep 17 00:00:00 2001 From: yhira Date: Thu, 31 Jan 2019 00:14:21 +0900 Subject: [PATCH] =?UTF-8?q?=E3=83=96=E3=83=AD=E3=82=B0=E3=82=AB=E3=83=BC?= =?UTF-8?q?=E3=83=89=E3=82=B9=E3=83=8B=E3=83=9A=E3=83=83=E3=83=88=E3=82=92?= =?UTF-8?q?All=20in=20One=20SEO=20Pack=E3=81=AB=E5=AF=BE=E5=BF=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/blogcard-in.php | 4 ++++ lib/seo.php | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/lib/blogcard-in.php b/lib/blogcard-in.php index 65b7ee748..95caceb36 100644 --- a/lib/blogcard-in.php +++ b/lib/blogcard-in.php @@ -72,6 +72,10 @@ function url_to_internal_blogcard_tag($url){ if (!$snipet) { $snipet = $post_data->post_excerpt; } + //All in One SEO Packのメタディスクリプションを取得 + if (!$snipet) { + $snipet = get_the_all_in_one_seo_pack_meta_description($id); + } //記事本文の抜粋文を取得 if (!$snipet) { $snipet = get_content_excerpt($post_data->post_content, get_entry_card_excerpt_max_length()); diff --git a/lib/seo.php b/lib/seo.php index c27c5e364..f0be19bff 100644 --- a/lib/seo.php +++ b/lib/seo.php @@ -546,10 +546,13 @@ function get_the_snipet($content, $length = 70) { //本文抜粋を取得する関数 //使用方法:http://nelog.jp/get_the_snipet if ( !function_exists( 'get_the_all_in_one_seo_pack_meta_description' ) ): -function get_the_all_in_one_seo_pack_meta_description() { +function get_the_all_in_one_seo_pack_meta_description($id = null) { global $post; + if (!$id) { + $id = $post->ID; + } if (class_exists( 'All_in_One_SEO_Pack' )) { - $aioseop_description = get_post_meta($post->ID, '_aioseop_description', true); + $aioseop_description = get_post_meta($id, '_aioseop_description', true); if ($aioseop_description) { return $aioseop_description; }