File: /www/wwwroot/www.sceybwg.com/wp-content/themes/Modular/template/module-page/theme-history-2.php
<?php
/**
* Template: 时间轴-2
* @Author: 大胡子
* @Email: dahuzi@xintheme.com
* @Link: www.xintheme.com
* @Date: 2023-08-01 07:27:28
* @Last Modified by: dahuzi
* @Last Modified time: 2024-11-06 17:37:27
*/
//模块id
$data_settings = wp_json_encode([
'id' => $module['id'],
]);
// 将 JSON 数据转义为 HTML 属性
$data_settings = esc_attr($data_settings);
//模块内容
if(is_array($module_content)){
//配色
$history_text_color = $module_setting['history_text_color'] ?? '';
$history_highlight_color = $module_setting['history_highlight_color'] ?? '';
$style_color = '';
if (!empty($history_text_color)) {
$style_color .= "--theme-history2-color: {$history_text_color};";
}
if (!empty($history_highlight_color)) {
$style_color .= "--theme-history2-hover-color: {$history_highlight_color};";
}
?>
<div class="section theme-history2 theme-history-<?php echo $module['id'];?>"<?php if( !empty($module_setting['module_bg']) ){ echo ' style="background:url('.$module_setting['module_bg'].') no-repeat center 0 / cover;"';}?> data-settings=<?php echo $data_settings;?>>
<div class="container"<?php echo $style_color ? ' style="' . $style_color . '"' : ''; ?>>
<?php
if( !empty($module_setting['title_display']) ){?>
<div class="section-title <?php echo $wow_style;?>">
<?php
if( !empty($module_title) ){
echo '<strong>'.$module_title.'</strong>';
}
if( !empty($module_desc) ){
echo '<p>'.$module_desc.'</p>';
}
?>
</div>
<?php }?>
<?php
if( isset($module_setting['history_position']) && $module_setting['history_position'] === 'position_top' ){?>
<div class="swiper history-swiper-date history-position-top<?php if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_2' ){ echo ' history-prev_next-none'; }?>">
<div class="swiper-wrapper">
<?php
foreach ($module_content as $value) {
if( !empty($value['item_date']) ){ ?>
<div class="swiper-slide">
<div class="history-date">
<p><?php echo $value['item_date'];?></p>
</div>
</div>
<?php
}
}?>
</div>
<?php
if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_1' ){?>
<div class="history-nav">
<div class="swiper-button-prev history-prev"></div>
<div class="swiper-button-next history-next"></div>
</div>
<?php }?>
</div>
<?php }?>
<div class="history-module">
<div class="swiper history-swiper">
<div class="swiper-wrapper">
<?php foreach ($module_content as $value) {?>
<div class="swiper-slide">
<div class="history-details">
<?php if( !empty($value['item_img']) ){?>
<div class="history-img">
<img loading="lazy" src="<?php echo $value['item_img'];?>" alt="" />
</div>
<?php }?>
<?php if( !empty($value['item_desc']) || !empty($value['item_title']) ){?>
<div class="history-text">
<?php
if( !empty($value['item_title']) ){
echo '<h3>'.$value['item_title'].'</h3>';
}
if( !empty($value['item_desc']) ){
echo do_shortcode($value['item_desc']);
}?>
</div>
<?php }?>
</div>
</div>
<?php }?>
</div>
</div>
</div>
<?php
if( isset($module_setting['history_position']) && $module_setting['history_position'] === 'position_bottom' ){?>
<div class="swiper history-swiper-date history-position-bottom<?php if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_2' ){ echo ' history-prev_next-none'; }?>">
<div class="swiper-wrapper">
<?php
foreach ($module_content as $value) {
if( !empty($value['item_date']) ){ ?>
<div class="swiper-slide">
<div class="history-date">
<p><?php echo $value['item_date'];?></p>
</div>
</div>
<?php
}
}?>
</div>
<?php
if( isset($module_setting['history_prev_next']) && $module_setting['history_prev_next'] === 'style_1' ){?>
<div class="history-nav">
<div class="swiper-button-prev history-prev"></div>
<div class="swiper-button-next history-next"></div>
</div>
<?php }?>
</div>
<?php }?>
</div>
</div>
<?php }
//echo wpjam_print_r( $module_setting );
//echo wpjam_print_r( $module_content );
//echo wpjam_print_r( $module_style );