feat: 新增聆韵(music)分类——列表页+单页+CSS+导航+Customizer
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: 聆韵列表
|
||||
*/
|
||||
get_header();
|
||||
|
||||
$query = new WP_Query(array(
|
||||
'post_type' => 'music',
|
||||
'posts_per_page' => -1,
|
||||
));
|
||||
?>
|
||||
|
||||
<div class="section-header">
|
||||
<span class="section-title">🎵 聆韵</span>
|
||||
<span class="section-filter" style="font-size:13px;color:var(--ink-lighter);"><?php echo esc_html(get_theme_mod('kjweji_music_subtitle', '音符落下,余韵未散')); ?></span>
|
||||
</div>
|
||||
|
||||
<?php if ($query->have_posts()) : ?>
|
||||
<div class="music-list">
|
||||
<?php while ($query->have_posts()) : $query->the_post(); ?>
|
||||
<a href="<?php the_permalink(); ?>" class="music-item">
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<div class="music-item__cover">
|
||||
<?php the_post_thumbnail('thumbnail', array('alt' => get_the_title())); ?>
|
||||
<span class="music-item__play">▶</span>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<div class="music-item__cover music-item__cover--empty">
|
||||
<span>🎵</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="music-item__body">
|
||||
<span class="music-item__title"><?php the_title(); ?></span>
|
||||
<span class="music-item__author"><?php the_author_meta('display_name'); ?> · <?php echo get_the_date('Y-m-d'); ?></span>
|
||||
</div>
|
||||
</a>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
<?php else : ?>
|
||||
<div class="music-empty">
|
||||
<span class="music-empty__icon">🎵</span>
|
||||
<p>尚无韵律,静待佳音</p>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
Reference in New Issue
Block a user