if (!defined('ABSPATH')) exit;
// WooCommerceのショッピングカート機能を無効化
function kick_the_beat_remove_woocommerce_cart() {
remove_action('wp_footer', 'woocommerce_cart_link');
remove_action('wp_footer', 'woocommerce_mini_cart');
remove_action('wp_head', 'woocommerce_generator');
remove_action('wp_head', 'woocommerce_output_enqueued_assets');
remove_action('wp_head', 'woocommerce_resource_hints');
remove_action('wp_head', 'woocommerce_persistent_cart');
remove_action('wp_head', 'woocommerce_cart_fragments');
}
add_action('wp_loaded', 'kick_the_beat_remove_woocommerce_cart');
// テーマのサポート機能を有効化
function kick_the_beat_setup() {
// カスタムメニューのサポート
register_nav_menus(array(
'primary' => __('Primary Menu', 'kick-the-beat-theme'),
));
// カスタム投稿タイプの登録
add_theme_support('post-thumbnails');
// メインビジュアルの背景画像サイズを追加
add_image_size('main_visual', 1920, 1080, true);
// カスタム投稿タイプ:トレーナー
register_post_type('trainer', array(
'labels' => array(
'name' => __('トレーナー', 'kick-the-beat-theme'),
'singular_name' => __('トレーナー', 'kick-the-beat-theme')
),
'public' => true,
'has_archive' => true,
'supports' => array('title', 'editor', 'thumbnail')
));
// WooCommerceのカート関連機能を無効化
remove_action('wp_footer', 'woocommerce_cart_link');
remove_action('wp_footer', 'woocommerce_mini_cart');
remove_action('wp_head', 'woocommerce_generator');
remove_action('wp_head', 'woocommerce_output_js');
remove_action('wp_head', 'woocommerce_resource_hints');
remove_action('wp_head', 'woocommerce_generator');
remove_action('wp_head', 'woocommerce_resource_hints');
remove_action('wp_head', 'woocommerce_resource_hints');
// WooCommerceのメニュー項目を非表示
add_filter('wp_nav_menu_items', 'remove_woocommerce_menu_items', 10, 2);
function remove_woocommerce_menu_items($items, $args) {
if ($args->theme_location == 'primary') {
$items = preg_replace('/
]*class="page-item-15"[^>]*>.*?<\/li>/i', '', $items);
$items = preg_replace('/]*class="page-item-17"[^>]*>.*?<\/li>/i', '', $items);
$items = preg_replace('/]*class="page-item-16"[^>]*>.*?<\/li>/i', '', $items);
}
return $items;
}
}
add_action('after_setup_theme', 'kick_the_beat_setup');
// スタイルシートとスクリプトの読み込み
function kick_the_beat_scripts() {
// フォントアワーソムの読み込み
wp_enqueue_style('font-awesome', 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0/css/all.min.css');
// スタイルシートの読み込み
wp_enqueue_style('kick-the-beat-style', get_stylesheet_uri());
// スクリプトの読み込み
wp_enqueue_script('kick-the-beat-script', get_template_directory_uri() . '/js/main.js', array('jquery'), '1.0', true);
}
add_action('wp_enqueue_scripts', 'kick_the_beat_scripts');
// カスタムテーマ設定
function kick_the_beat_customize_register($wp_customize) {
// メインビジュアル設定
$wp_customize->add_section('main_visual_section', array(
'title' => __('メインビジュアル', 'kick-the-beat-theme'),
'priority' => 30,
));
$wp_customize->add_setting('main_visual_image', array(
'default' => '',
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control(new WP_Customize_Image_Control(
$wp_customize,
'main_visual_image',
array(
'label' => __('メインビジュアルの背景画像', 'kick-the-beat-theme'),
'section' => 'main_visual_section',
'type' => 'image',
)
));
$wp_customize->add_setting('main_title', array(
'default' => __('キックボクシングで', 'kick-the-beat-theme'),
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('main_title', array(
'label' => __('メインタイトル', 'kick-the-beat-theme'),
'section' => 'main_visual_section',
'type' => 'text',
));
$wp_customize->add_setting('main_subtitle', array(
'default' => __('+ 先着10名様まで!2025年 新生活応援キャンペーン!', 'kick-the-beat-theme'),
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('main_subtitle', array(
'label' => __('サブタイトル', 'kick-the-beat-theme'),
'section' => 'main_visual_section',
'type' => 'text',
));
// お問い合わせ情報設定
$wp_customize->add_section('contact_section', array(
'title' => __('お問い合わせ情報', 'kick-the-beat-theme'),
'priority' => 30,
));
$wp_customize->add_setting('contact_phone', array(
'default' => __('000-0000-0000', 'kick-the-beat-theme'),
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('contact_phone', array(
'label' => __('電話番号', 'kick-the-beat-theme'),
'section' => 'contact_section',
'type' => 'text',
));
$wp_customize->add_setting('contact_email', array(
'default' => __('info@example.com', 'kick-the-beat-theme'),
'sanitize_callback' => 'sanitize_email',
));
$wp_customize->add_control('contact_email', array(
'label' => __('メールアドレス', 'kick-the-beat-theme'),
'section' => 'contact_section',
'type' => 'email',
));
// ソーシャルメディア設定
$wp_customize->add_section('social_section', array(
'title' => __('ソーシャルメディア', 'kick-the-beat-theme'),
'priority' => 30,
));
$wp_customize->add_setting('facebook_url', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control('facebook_url', array(
'label' => __('Facebook URL', 'kick-the-beat-theme'),
'section' => 'social_section',
'type' => 'url',
));
$wp_customize->add_setting('instagram_url', array(
'sanitize_callback' => 'esc_url_raw',
));
$wp_customize->add_control('instagram_url', array(
'label' => __('Instagram URL', 'kick-the-beat-theme'),
'section' => 'social_section',
'type' => 'url',
));
// フッター設定
$wp_customize->add_section('footer_section', array(
'title' => __('フッター', 'kick-the-beat-theme'),
'priority' => 30,
));
$wp_customize->add_setting('footer_contact_info', array(
'default' => __('電話番号を設定してください', 'kick-the-beat-theme'),
'sanitize_callback' => 'sanitize_text_field',
));
$wp_customize->add_control('footer_contact_info', array(
'label' => __('フッターの連絡先情報', 'kick-the-beat-theme'),
'section' => 'footer_section',
'type' => 'text',
));
}
add_action('customize_register', 'kick_the_beat_customize_register');
キックボクシングで健康に痩せよう
+ 先着10名様まで!2025年 新生活応援キャンペーン!
サービス紹介
キックボクシングビギナー
初めての方や初心者、女性におすすめ
自重・有酸素トレーニング
運動不足やダイエット目的の方に
ムエタイ
キックボクシングにない動き(肘打ちなど)も
キャンペーン情報
新生活応援キャンペーン
先着10名様まで!
期間限定の特別価格でご案内します。
詳細はお問い合わせください。