<?xml version="1.0" encoding="UTF-8"?>        <rss version="2.0"
             xmlns:atom="http://www.w3.org/2005/Atom"
             xmlns:dc="http://purl.org/dc/elements/1.1/"
             xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
             xmlns:admin="http://webns.net/mvcb/"
             xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
             xmlns:content="http://purl.org/rss/1.0/modules/content/">
        <channel>
            <title>
									カスタム投稿のOGPタグの上書きについて - Cocoonテーマに関する質問				            </title>
            <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/</link>
            <description>Cocoon ディスカッション掲示板</description>
            <language>ja</language>
            <lastBuildDate>Fri, 13 Mar 2026 08:21:40 +0000</lastBuildDate>
            <generator>wpForo</generator>
            <ttl>60</ttl>
							                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76770</link>
                        <pubDate>Wed, 24 Jan 2024 12:30:12 +0000</pubDate>
                        <description><![CDATA[ご確認いただきありがとうございます！今後ともよろしくお願いいたします。]]></description>
                        <content:encoded><![CDATA[<p>ご確認いただきありがとうございます！<br />今後ともよろしくお願いいたします。</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>わいひら</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76770</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76755</link>
                        <pubDate>Wed, 24 Jan 2024 00:53:38 +0000</pubDate>
                        <description><![CDATA[@yhira さん、ありがとうございます。
希望通りの結果になりました！
 
とても便利で使いやすいテーマで重宝しています。
今後ともよろしくお願いいたします。]]></description>
                        <content:encoded><![CDATA[<p>@yhira さん、ありがとうございます。</p>
<p>希望通りの結果になりました！</p>
<p> </p>
<p>とても便利で使いやすいテーマで重宝しています。</p>
<p>今後ともよろしくお願いいたします。</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>robjhon</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76755</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76743</link>
                        <pubDate>Tue, 23 Jan 2024 13:58:29 +0000</pubDate>
                        <description><![CDATA[ogp_card_ogp_imageフックを追加しておきました]]></description>
                        <content:encoded><![CDATA[<p>ogp_card_ogp_imageフックを追加しておきました。<br />https://github.com/xserver-inc/cocoon/blob/1284b1382ff52620342015866e235843587faa99/tmp/header-ogp.php#L75<br />https://github.com/xserver-inc/cocoon/blob/1284b1382ff52620342015866e235843587faa99/tmp/header-twitter-card.php#L75<br /><br /><br /><br />タイトルやディスクリプション同様、カスタム投稿アーカイブページ毎に画像を設定できたら良いのではないかと思います。<br /><br /><br /><br />タクソノミページのアイキャッチも反映されるように修正しました。<br />https://github.com/xserver-inc/cocoon/commit/1284b1382ff52620342015866e235843587faa99</p>
<p> </p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>わいひら</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76743</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76736</link>
                        <pubDate>Tue, 23 Jan 2024 11:34:32 +0000</pubDate>
                        <description><![CDATA[@yhira さん、はいそうです。
カスタム投稿の単一ページは、各投稿で設定できるのだと思いますが、
カスタム投稿のアーカイブページの画像は、現在はダッシュボードのCocoonで設定したものが表示されてると思います。
タイトルやディスクリプション同様、カスタム投稿アーカイブページ毎に画像を設定できたら良いのではないかと思います。]]></description>
                        <content:encoded><![CDATA[<p>@yhira さん、はいそうです。</p>
<p>カスタム投稿の単一ページは、各投稿で設定できるのだと思いますが、</p>
<p>カスタム投稿のアーカイブページの画像は、現在はダッシュボードのCocoonで設定したものが表示されてると思います。</p>
<p>タイトルやディスクリプション同様、カスタム投稿アーカイブページ毎に画像を設定できたら良いのではないかと思います。</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>robjhon</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76736</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76727</link>
                        <pubDate>Tue, 23 Jan 2024 10:38:30 +0000</pubDate>
                        <description><![CDATA[こちらのog:image（Twitterカードのtwitter:imageも）の$ogp_image変数の値を変更するということでしょうか]]></description>
                        <content:encoded><![CDATA[<p></p>
<p>ちなみに、同じようなやり方で、カスタム投稿のアーカイブページのアイキャッチ画像をfunction.phpで変更できるでしょうか？</p>
<p></p>
<p>こちらのog:image（Twitterカードのtwitter:imageも）の$ogp_image変数の値を変更するということでしょうか？<br />https://github.com/xserver-inc/cocoon/blob/411bb888d9c9d04d4105bda7bc5c3989a56aaed7/tmp/header-ogp.php#L60<br />そうだとしたらフックを追加しておきましょうか？</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>わいひら</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76727</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76725</link>
                        <pubDate>Tue, 23 Jan 2024 10:33:49 +0000</pubDate>
                        <description><![CDATA[すいません。GitHubのファイルを修正しておきました]]></description>
                        <content:encoded><![CDATA[<p>すいません。GitHubのファイルを修正しておきました。<br />https://github.com/xserver-inc/cocoon/commit/fbdcf7846180a81851531b2373b9d2572b8ce4f9</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>わいひら</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76725</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76721</link>
                        <pubDate>Tue, 23 Jan 2024 07:51:54 +0000</pubDate>
                        <description><![CDATA[$description = apply_filters(&#039;ogp_card_description&#039;, $description);
に変更したら上書きできました。
 
ちなみに、同じようなやり方で、カスタム投稿のアーカイブページのアイキャッチ画像をfunction.phpで変更できるでしょうか？]]></description>
                        <content:encoded><![CDATA[<div><span>$description</span><span> = </span><span>apply_filters</span><span>(</span><span>'ogp_card_description'</span><span>, </span><span>$description</span><span>);</span></div>
<div>に変更したら上書きできました。</div>
<div> </div>
<div>ちなみに、同じようなやり方で、カスタム投稿のアーカイブページのアイキャッチ画像をfunction.phpで変更できるでしょうか？</div>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>robjhon</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76721</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76720</link>
                        <pubDate>Tue, 23 Jan 2024 07:08:40 +0000</pubDate>
                        <description><![CDATA[●原因
追加された、母体にコーディングミスがあります。代入先が$titleとなっている為、上書きされ、ディスクリプションとなってしまう。

●対策
代入先$titleを、$descriptionに修正する。
&gt;わいひらさん
修正願います。]]></description>
                        <content:encoded><![CDATA[<p><strong>●原因</strong></p>
<p>追加された、母体にコーディングミスがあります。<br />代入先が<span style="color: #ff0000">$title</span>となっている為、上書きされ、<span>ディスクリプションとなってしまう。</span></p>
<p><a href="https://github.com/xserver-inc/cocoon/blob/8c97b4ca075d8dccee7fc46d95fec7e7f7a130a6/tmp/header-ogp.php#L53" target="_blank" rel="noopener">https://github.com/xserver-inc/cocoon/blob/8c97b4ca075d8dccee7fc46d95fec7e7f7a130a6/tmp/header-ogp.php#L53</a></p>
<p><a href="https://github.com/xserver-inc/cocoon/blob/8c97b4ca075d8dccee7fc46d95fec7e7f7a130a6/tmp/header-twitter-card.php#L53" target="_blank" rel="noopener">https://github.com/xserver-inc/cocoon/blob/8c97b4ca075d8dccee7fc46d95fec7e7f7a130a6/tmp/header-twitter-card.php#L53</a></p>
<hr />
<p><strong>●対策</strong></p>
<p>代入先$titleを、$descriptionに修正する。</p>
<p><strong>&gt;わいひらさん</strong></p>
<p>修正願います。</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>大門未知子</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76720</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76719</link>
                        <pubDate>Tue, 23 Jan 2024 06:54:47 +0000</pubDate>
                        <description><![CDATA[ご回答ありがとうございます。
わいひらさんがご提供頂いた、フィルターフックを親テーマに追加して、function.phpに次のように書いたところ、次のような結果になりました。og:titieに上書きしたディスクリプションが反映されてしまいます。
どこがいけないでしょうか？
&lt;?php
function customize_meta_and_ogp_tags()
...]]></description>
                        <content:encoded><![CDATA[<p>ご回答ありがとうございます。</p>
<p>わいひらさんがご提供頂いた、フィルターフックを親テーマに追加して、function.phpに次のように書いたところ、次のような結果になりました。<br /><br />og:titieに上書きしたディスクリプションが反映されてしまいます。</p>
<p>どこがいけないでしょうか？</p>
<pre contenteditable="false">&lt;?php
function customize_meta_and_ogp_tags()
{
  if (is_post_type_archive('schoolinfo')) {
    // 共通のタイトル、ディスクリプション、キーワード
    $new_title = '全国のジュエリースクールやアクセサリー彫金教室一覧  |  ジュエリークラフト';
    $new_description = '日本全国のジュエリースクールやアクセサリー教室、彫金教室を一覧でご紹介。東京・大阪など都道府県による絞込検索や、関東・関西などエリアによる絞込検索が可能。また、ジュエリーアクセサリーのジャンルとして、彫金・ワックスモデリング・CAD・デザイン・石研磨・彫り留め・銀粘土やアートクレイ・天然石・ビーズ・ガラス・ハンドメイド・ビジネスなど、ジャンルによる絞込検索も可能。';
    $new_keywords = 'ジュエリースクール,アクセサリー教室,彫金教室,全国,日本';

    // 通常のメタタグの上書き
    add_filter('pre_get_document_title', function () use ($new_title) {
      return $new_title;
    });
    add_action('wp_head', function () use ($new_description, $new_keywords) {
      echo '&lt;meta name="description" content="' . $new_description . '"&gt;' . "\n";
      echo '&lt;meta name="keywords" content="' . $new_keywords . '"&gt;' . "\n";
    }, 1);

    // CocoonテーマのOGPフィルターフックを使用したOGPタイトルとディスクリプションの上書き
    add_filter('ogp_card_title', function () use ($new_title) {
      return $new_title;
    });
    add_filter('ogp_card_description', function () use ($new_description) {
      return $new_description;
    });
  }
}
add_action('wp', 'customize_meta_and_ogp_tags', 0);
?&gt;
</pre>
<p> </p>
<p> </p>
<p>＜結果（ツイッターも同様）＞</p>
<pre contenteditable="false">&lt;title&gt;全国のジュエリースクールやアクセサリー彫金教室一覧  |  ジュエリークラフト&lt;/title&gt;
&lt;meta name="description" content="日本全国のジュエリースクールやアクセサリー教室、彫金教室を一覧でご紹介。東京・大阪など都道府県による絞込検索や、関東・関西などエリアによる絞込検索が可能。また、ジュエリーアクセサリーのジャンルとして、彫金・ワックスモデリング・CAD・デザイン・石研磨・彫り留め・銀粘土やアートクレイ・天然石・ビーズ・ガラス・ハンドメイド・ビジネスなど、ジャンルによる絞込検索も可能。"&gt;
&lt;meta name="keywords" content="ジュエリースクール,アクセサリー教室,彫金教室,全国,日本"&gt;

&lt;meta property="og:title" content="日本全国のジュエリースクールやアクセサリー教室、彫金教室を一覧でご紹介。東京・大阪など都道府県による絞込検索や、関東・関西などエリアによる絞込検索が可能。また、ジュエリーアクセサリーのジャンルとして、彫金・ワックスモデリング・CAD・デザイン・石研磨・彫り留め・銀粘土やアートクレイ・天然石・ビーズ・ガラス・ハンドメイド・ビジネスなど、ジャンルによる絞込検索も可能。"&gt;
&lt;meta property="og:description" content="「ジュエリークラフト（Jewelry Craft）」は、ジュエリー制作と彫金技術・アクセサリー制作と販売に関する情報を提供するWEBメディアです。"&gt;

</pre>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>robjhon</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76719</guid>
                    </item>
				                    <item>
                        <title>RE: カスタム投稿のOGPタグの上書きについて</title>
                        <link>https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76689</link>
                        <pubDate>Mon, 22 Jan 2024 12:39:29 +0000</pubDate>
                        <description><![CDATA[ogp_card_descriptionフィルターフックを追加しておきました]]></description>
                        <content:encoded><![CDATA[<p>ogp_card_descriptionフィルターフックを追加しておきました。<br />https://github.com/xserver-inc/cocoon/commit/57d024b97ad972d42506cc7a955e10f99a59446d<br /><br />※改めて見てみるとsns_card_titleは不要だったかもしれない。とりあえず使っている人がいるかもしれないので残しておきます。</p>]]></content:encoded>
						                            <category domain="https://wp-cocoon.com/community/cocoon-theme/">Cocoonテーマに関する質問</category>                        <dc:creator>わいひら</dc:creator>
                        <guid isPermaLink="true">https://wp-cocoon.com/community/cocoon-theme/%e3%82%ab%e3%82%b9%e3%82%bf%e3%83%a0%e6%8a%95%e7%a8%bf%e3%81%aeogp%e3%82%bf%e3%82%b0%e3%81%ae%e4%b8%8a%e6%9b%b8%e3%81%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6/#post-76689</guid>
                    </item>
							        </channel>
        </rss>
		