ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
▶css lessではなく カスタム投稿タイプはcssを使う そして管理画面にて分岐 使う使わない
▶fanc 投稿タイプの利用未利用は管理画面から可能 phpのため
そーすれば、使うか使わないかは、DBで管理できるので、親テーマに入れとけばよくなるのでは????
ーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーーー
親テーマファンクション
///////////////////カスタム投稿タイプ/////////////////
///カスタム投稿タイプ welcartfanckを管理画面でインサート
$c_cutom_post_type = get_field("cutom_post_type",7140);
if (in_array("地域", $c_cutom_post_type)) {
// 地域
require_once locate_template('4_custom/service_chiiki/service_chiiki_func.php');
}
if (in_array("実績", $c_cutom_post_type)) {
// KEN設計 からの 事例
require_once locate_template('4_custom/newlybuilt/newlybuilt_func.php');
}
if (in_array("youtube", $c_cutom_post_type)) {
// youtube
require_once locate_template('4_custom/youtube/youtube_func.php');
}
if (in_array("中古車", $c_cutom_post_type)) {
// 中古車
require_once locate_template('4_custom/car/car_func.php');
}
if (in_array("イベント", $c_cutom_post_type)) {
// イベント お昼レゲエ 202502
require_once locate_template('4_custom/event/event_func.php');
}
if (in_array("スタッフ簡易202501", $c_cutom_post_type)) {
// スタッフ簡易202501
require_once locate_template('4_custom/staff202501/staff202501_func.php');
}
if (in_array("スタッフ個ページあり202502", $c_cutom_post_type)) {
// スタッフ 個ページ あり 202502
require_once locate_template('4_custom/staff202502/staff202502_func.php');
}
if (in_array("レッスンヨガアース", $c_cutom_post_type)) {
// レッスン ヨガ アース
require_once locate_template('4_custom/lesson/lesson_func.php');
}
//////////////使い道なし
// HP制作実績
//require_once locate_template('4_custom/d_jirei_hp/d_jirei_hp_func.php');
// お客様の声
//require_once locate_template('4_custom/koe/koe_func.php');
///////////////////オンラインショップ/////////////////
if (in_array("welcart", $c_cutom_post_type)) {
// welcart
require_once locate_template('4_custom/welcart/welcart_func.php');
}else{
//welcart_fancを入れない場合、エラーになるから これをオープンする
//空で指定
$welcart_cat = '';
$welcart_cat_out = '';
$itemreco = '';
$itemnew = '';
$welcart_genre = '';
}
親テーマ d_0header
init.css の後に
<?php //202510 管理画面にてCSSをコントロール カスタム投稿タイプと連動 条件は lessを cssにしなければならない
$c_cutom_post_type = get_field("cutom_post_type",7140);//welcartのテンプレートではこれを読めないからここに再度記載
?>
<?php //welcart
if (in_array("レッスンヨガアース", $c_cutom_post_type)) : ?>
<link href="<?php echo get_template_directory_uri(); ?>/4_custom/welcart/welcart.css?<?php echo filemtime( get_template_directory()."/4_custom/welcart/welcart.css"); ?>" rel="stylesheet" type="text/css" />
<?php endif; ?>
css
f1_colorに
:root {
--site_color : #000000; //サイトの基本カラー
}
welcart.css コメントアウト その他調整必要
/* //カートに入れるをボタン */
#welcart_single {
input.skubutton {
width: 100%;
font-size: 16px;
padding: 0.8em;
background-color: var(--site_color);
color: #fff;
}
}