File: /www/wwwroot/www.sceybwg.com/wp-content/themes/Modular/template/module-page/theme-download.php
<?php
/**
* Template: 时间轴
* @Author: 大胡子
* @Email: dahuzi@xintheme.com
* @Link: www.xintheme.com
* @Date: 2023-08-01 07:27:28
* @Last Modified by: dahuzi
* @Last Modified time: 2024-08-28 16:25:57
*/
if(is_array($module_content)){?>
<div class="section"<?php if( !empty($module_setting['module_bg']) ){ echo ' style="background:url('.$module_setting['module_bg'].') no-repeat center 0 / cover;"';}?>>
<div class="container">
<?php
if( !empty($module_setting['title_display']) ){?>
<div class="section-title <?php echo $wow_style;?><?php if( !empty($module_setting['module_bg']) ){ echo ' text-colour-white';}?>">
<?php
if( !empty($module_title) ){
echo '<strong>'.$module_title.'</strong>';
}
if( !empty($module_desc) ){
echo '<p>'.$module_desc.'</p>';
}
?>
</div>
<?php }?>
<div class="list-six <?php if( !empty($module_setting['contact_style']) ){ echo $module_setting['contact_style'];}?>">
<?php
if( !empty($module_content['download_id']) ){
// 获取指定 ID 的文章
$downloadArray = array(
'post_type' => 'download',
'post__in' => $module_content['download_id'],
'orderby' => 'post__in',
);
$download_query = wpjam_query($downloadArray);
if ($download_query->have_posts()) {
while ($download_query->have_posts()) {
$download_query->the_post();
//获取文件下载地址
$download_url = get_post_meta(get_the_ID(), 'download_url', true);
//获取文章缩略图
$get_post_thumbnail_url = wpjam_get_post_thumbnail_url();
//图片Alt标签
if(!empty($get_post_thumbnail_url)){
$img_alt = get_the_title();
}
?>
<div class="post-download">
<?php
if(!empty($get_post_thumbnail_url)){
echo '<div class="download-img">';
echo '<img loading="lazy" src="'.$get_post_thumbnail_url.'" alt="'.$img_alt.'">';
echo '</div>';
}?>
<div class="download-title">
<h2><?php the_title();?></h2>
<?php the_excerpt();?>
<?php
if($module_setting['contact_style'] == 'style_3'){
echo '<div class="download-button">';
echo '<a href="'.$download_url.'" target="_blank" rel="nofollow">';
echo '<i class="ri-download-cloud-line"></i> '.__( '点击下载', 'modular_theme' );
echo '</a>';
echo '</div>';
}
?>
</div>
<?php
if(!empty($download_url)){
if($module_setting['contact_style'] != 'style_3'){
echo '<div class="download-button">';
echo '<a href="'.$download_url.'" target="_blank" rel="nofollow">';
echo '<i class="ri-download-cloud-line"></i> '.__( '点击下载', 'modular_theme' );
echo '</a>';
echo '</div>';
}
echo '<a class="download-link" href="'.$download_url.'" target="_blank" rel="nofollow"></a>';
}?>
</div>
<?php
}
}
}?>
</div>
</div>
</div>
<?php }
//echo wpjam_print_r( $module_setting );
//echo wpjam_print_r( $module_content );
//echo wpjam_print_r( $module_style );