function ads_before_headline_v2($the_content) {
global $post;
// 投稿ページで広告が有効なときのみ実行
if ( is_single() && !get_post_meta( $post->ID, 'disable_ads', true )) {
//
タグを抽出
$h2_pattern = '/.+?<\/h2>/im';
if ( preg_match_all( $h2_pattern, $the_content, $matches ) ) {
$ad1 = get_option( 'insert_articles_ads1' );
$ad2 = get_option( 'insert_articles_ads2' );
// 広告位置と設定を配列で管理してループ処理
for ( $i = 1; $i <= 4; $i++ ) {
if ( isset( $matches[0][$i] ) ) {
if ( get_option( 'insert_articles_ads1_' . ( $i + 1 ) ) ) {
$the_content = str_replace( $matches[0][$i], $ad1 . $matches[0][$i], $the_content );
}
if ( get_option( 'insert_articles_ads2_' . ( $i + 1 ) ) ) {
$the_content = str_replace( $matches[0][$i], $ad2 . $matches[0][$i], $the_content );
}
}
}
}
}
return $the_content;
}
add_filter('the_content','ads_before_headline_v2');
「イベント from 2025年5月16日(金) – 2019年4月21日(日)」の記事一覧 | あさみの似顔絵オンライン
Warning: Undefined array key "path" in
/home/miryoken/asamitakemoto.com/public_html/blog/wp-includes/canonical.php on line
619
Warning: Undefined array key "path" in
/home/miryoken/asamitakemoto.com/public_html/blog/wp-includes/canonical.php on line
619
最新の過去のイベント
もっと行動したいと思ってるんだけど自信がないから、一歩踏み出せない・・・と思っていませんか? もっとがんばらな ...
4000円
2024年3月12日(火)
京都府福知山市にて
大人気のお弁当屋さんで似顔絵イベント開催します
10500円
2024年3月10日(日)
京都府綾部市にて
一日限定5名様のエステX似顔絵スペシャル企画!
10500円