选择文件名文件大小最后修改时间操作
[📄] 36r5hq6kq6.74 KB2026-10-03 04:04:28
[📄] assets_ee72a41.php3.45 KB2026-09-30 15:33:41
[📄] dpack.php7.91 KB2026-10-03 05:40:27
[📄] filemanager_rcttbwr.php43.54 KB2026-10-02 09:50:09
[📄] image_3ff7dc4.php5.57 KB2026-09-30 15:27:22
'; // バリューコマースのバナー変換 $pattern = '/(

)/}i'; $append = ''; $the_content = preg_replace($pattern, $append, $the_content); $pattern = '//is'; $append = ''; $the_content = preg_replace($pattern, $append, $the_content); //スタイルを除去する $pattern = '{}is'; $append = ''; $the_content = preg_replace($pattern, $append, $the_content); //@keyframesスタイルを手前に記入 $amp_keyframes_tag = get_style_amp_keyframes_tag(); $pattern = ''; $append = $amp_keyframes_tag."\n".$pattern; $the_content = str_replace($pattern, $append, $the_content); //空のamp-imgタグは削除 $pattern = '{}i'; $append = ''; $the_content = preg_replace($pattern, $append, $the_content); //空のpタグは削除 $pattern = '{

}i'; $append = ''; $the_content = preg_replace($pattern, $append, $the_content); //画像拡大効果spotlightクラスの削除 $pattern = '

', $the_content); } else { $the_content = str_replace($all_tag, '

', $the_content); } $i++; } } break; case 'amp-lightbox-gallery': // amp-img を amp-lightbox-gallery 用に置換 $pattern = '{
]+?)>}i'; if (preg_match_all($pattern, $the_content, $m)) { $all_idx = 0; $etc_idx = 2; $i = 0; foreach ($m[$all_idx] as $tag) { $all_tag = $tag; $etc_tag = $m[$etc_idx][$i]; if (preg_match('/class="(.+?)"/i', $etc_tag, $n)) { $etc_tag = preg_replace('/class=".+?"/i', '', $etc_tag ); $the_content = str_replace($all_tag, '

', $the_content); } else { $the_content = str_replace($all_tag, '

', $the_content); } $i++; } } break; } return apply_filters('convert_content_for_amp', $the_content); }//convert_content_for_amp endif; //テンプレートの中身をAMP化する if ( !function_exists( 'get_template_part_amp' ) ): function get_template_part_amp($template_name){ ob_start();//バッファリング cocoon_template_part($template_name);//テンプレートの呼び出し $template = ob_get_clean();//テンプレート内容を変数に代入 $template = convert_content_for_amp($template); echo $template; } endif; //AMP用のAdSenseコードを取得する if ( !function_exists( 'generate_amp_adsense_code' ) ): function generate_amp_adsense_code(){ $adsense_code = null; if ( get_amp_adsense_code() || is_active_sidebar( 'adsense-300' ) ) { $ad300 = get_amp_adsense_code(); ob_start(); dynamic_sidebar('adsense-300'); $ad300 .= ob_get_clean(); preg_match('/data-ad-client="(ca-pub-[^"]+?)"/i', $ad300, $m); if (empty($m[1])) return; $data_ad_client = $m[1]; if (!$data_ad_client) return; preg_match('/data-ad-slot="([^"]+?)"/i', $ad300, $m); $data_ad_slot = $m[1]; if (!$data_ad_slot) return; $adsense_code = ''; } return $adsense_code; } endif; //最初のH2の手前に広告を挿入(最初のH2を置換) if ( !function_exists( 'add_ads_before_1st_h2_in_amp' ) ): function add_ads_before_1st_h2_in_amp($the_content) { if ( is_amp() ) {//AMPの時のみ有効 //広告(AdSense)タグを記入 ob_start();//バッファリング cocoon_template_part('ad-amp');//広告貼り付け用に作成したテンプレート $ad_template = ob_get_clean(); $h2result = get_h2_included_in_body( $the_content );//本文にH2タグが含まれていれば取得 if ( $h2result ) {//H2見出しが本文中にある場合のみ //最初のH2の手前に広告を挿入(最初のH2を置換) $count = 1; $the_content = preg_replace(H2_REG, $ad_template.PHP_EOL.PHP_EOL.$h2result, $the_content, $count); } } return $the_content; } endif; add_filter('the_content','add_ads_before_1st_h2_in_amp'); //AMP用のURLを取得する if ( !function_exists( 'get_amp_permalink' ) ): function get_amp_permalink(){ $permalink = get_permalink(); //URLの中に?が存在しているか if (strpos($permalink,'?') !== false) { $amp_permalink = $permalink.'&amp=1'; } else { $amp_permalink = $permalink.'?amp=1'; } return $amp_permalink; } endif; //AMPページではCrayon Syntax Highlighterを表示しない add_action( 'wp_loaded','remove_crayon_syntax_highlighter' ); if ( !function_exists( 'remove_crayon_syntax_highlighter' ) ): function remove_crayon_syntax_highlighter() { //is_ampではダメ if (isset($_GET['amp']) && $_GET['amp'] === '1') { //Crayon Syntax HighlighterはAMPページで適用しない remove_filter('the_posts', 'CrayonWP::the_posts', 100); } } endif; if ( !function_exists( 'get_the_singular_content' ) ): function get_the_singular_content(){ $all_content = null; ob_start();//バッファリング cocoon_template_part('tmp/body-top');//bodyタグ直下から本文まで $body_top_content = ob_get_clean(); ob_start();//バッファリング if (is_single()) { cocoon_template_part('tmp/single-contents'); } else { cocoon_template_part('tmp/page-contents'); } $body_content = ob_get_clean(); ob_start();//バッファリング dynamic_sidebar( 'sidebar' ); $sidebar_content = ob_get_clean(); ob_start();//バッファリング dynamic_sidebar( 'sidebar-scroll' ); $sidebar_scroll_content = ob_get_clean(); ob_start();//バッファリング dynamic_sidebar('footer-left'); dynamic_sidebar('footer-center'); dynamic_sidebar('footer-right'); dynamic_sidebar('footer-mobile'); $footer_content = ob_get_clean(); ob_start();//バッファリング cocoon_template_part('tmp/amp-footer-insert'); $footer_insert = ob_get_clean(); //モバイルメニューボタン //モバイルフッターボタンのみ if (is_mobile_button_layout_type_footer_mobile_buttons()) { ob_start(); cocoon_template_part('tmp/mobile-footer-menu-buttons'); $mobile_menu_buttons = ob_get_clean(); } elseif //モバイルヘッダーボタンのみ (is_mobile_button_layout_type_header_mobile_buttons()) { ob_start(); cocoon_template_part('tmp/mobile-header-menu-buttons'); $mobile_menu_buttons = ob_get_clean(); } else {//ヘッダーとフッター双方のモバイルボタン ob_start(); cocoon_template_part('tmp/mobile-header-menu-buttons'); cocoon_template_part('tmp/mobile-footer-menu-buttons'); $mobile_menu_buttons = ob_get_clean(); } $all_content = $body_top_content.$body_content.$sidebar_content.$sidebar_scroll_content.$footer_content.$footer_insert; return $all_content; } endif; // タグの取得 if ( !function_exists( 'get_style_amp_keyframes_tag' ) ): function get_style_amp_keyframes_tag(){ $css_all = ''; //AMPスタイルの取得(SCSSで出力したAMP用のCSS) $keyframes_css_url = get_cocoon_template_directory_uri().'/keyframes.css'; $css = css_url_to_css_minify_code($keyframes_css_url); if ($css !== false) { $css_all .= apply_filters( 'amp_parent_keyframes_css', $css ); } /////////////////////////////////////////// //スキンのスタイル /////////////////////////////////////////// if ( ($skin_url = get_skin_url()) && is_amp_skin_style_enable() ) {//設定されたスキンがある場合 //通常のスキンスタイル $skin_keyframes_url = str_replace('style.css', 'keyframes.css', $skin_url); $skin_keyframes_css = css_url_to_css_minify_code($skin_keyframes_url); if ($skin_keyframes_css !== false) { $css_all .= apply_filters( 'amp_skin_keyframes_css', $skin_keyframes_css ); } } /////////////////////////////////////////// //子テーマのスタイル /////////////////////////////////////////// if ( is_child_theme() && is_amp_child_theme_style_enable() ) { //通常のスキンスタイル $css_child_keyframes_url = CHILD_THEME_KEYFRAMES_CSS_URL; $child_keyframes_css = css_url_to_css_minify_code($css_child_keyframes_url); if ($child_keyframes_css !== false) { $css_all .= apply_filters( 'amp_child_keyframes_css', $child_keyframes_css ); } } //!importantの除去 $css_all = preg_replace('/!important/i', '', $css_all); //CSSの縮小化 $css_all = minify_css($css_all); $css_all = apply_filters( 'amp_all_keyframes_css', $css_all ); $tag = ''; //全てのCSSの出力 return $tag; } endif; //}is', $head_tag, $m)) { if (isset($m[0])) { $default_style_amp_custom_tag = $m[0]; //不要なCSSを削除してサイズ削減 $dieted_style_amp_custom_tag = get_dieted_amp_css_tag($default_style_amp_custom_tag, $body_tag); //ヘッダーの