テーマエディターfunctions.php スタディングに変更

'ひらがなを含む必要があります。');
}
return $result;
}

// 一括アレンジ
function add_custom_html_before_first_heading_and_after_post_content($content) {
// 投稿ページかつメインクエリでのみ実行
if (is_single() && is_main_query()) {
// 「ad」タグが付いている場合は非表示にする
if (has_tag('ad')) {
return $content; // 「ad」タグがある場合、そのままコンテンツを返す(HTMLを追加しない)
}

// 追加するHTMLコンテンツ
$custom_html = '

\ キャンペーン実施中 /

合格を目指して学習スタート!

';

// 最初の見出し(

)タグの前に追加
$content = preg_replace('/(]*>)/', $custom_html . '$1', $content, 1);

// コンテンツの最後に追加
$content .= $custom_html;
}

// 修正したコンテンツを返す
return $content;
}
add_filter('the_content', 'add_custom_html_before_first_heading_and_after_post_content');

© 2026 BIT 会計ファイナンス