wordpressの記事タイトルにショートコードを入れた際に、記事内や記事一覧では変換されるが、タブやgoogle検索時に表示されるタイトルは変換されません。
お力を貸していただければ幸いです。
よろしくお願いします。
function shortcode_today() { return date_i18n("Y年n月"); } add_shortcode('today_date', 'shortcode_today'); function my_feeds($content) { global $post; $content = str_replace('"','"', $content); $content = do_shortcode($content); return $content; } add_filter('the_title_test', 'my_feeds'); /* 利用する場所 */ add_filter('the_content', 'do_shortcode'); add_filter('get_the_content', 'do_shortcode'); add_filter('widget_text', 'do_shortcode'); add_filter('the_title', 'do_shortcode'); add_filter('the_title_rss', 'my_feeds');
回答1件
あなたの回答
tips
プレビュー