空笺未寄 v1.0 — 基于 DeepSeek UI 的 WordPress 主题
页面:首页、笺文、微言、拾影、文章详情、作者页 功能:三种展示方式、tucao 自定义类型、评论、分页、灯箱 CSS:DeepSeek 原 CSS + 系统字体 + 头像本地化 安装:激活主题后自动创建页面和导航,刷新固定链接即可
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
/**
|
||||
* Template Name: 拾影画廊
|
||||
*/
|
||||
|
||||
get_header();
|
||||
|
||||
// 获取所有带特色图片的文章(普通文章 + 可选 tucao)
|
||||
$photo_query = new WP_Query(array(
|
||||
'post_type' => 'post',
|
||||
'posts_per_page' => -1,
|
||||
'meta_key' => '_thumbnail_id',
|
||||
));
|
||||
?>
|
||||
|
||||
<div class="section-header">
|
||||
<span class="section-title">📷 拾影</span>
|
||||
<span class="section-filter" style="font-size:13px;color:var(--ink-lighter);">被光留下的瞬间</span>
|
||||
</div>
|
||||
|
||||
<?php if ($photo_query->have_posts()) : ?>
|
||||
<div class="gallery-masonry">
|
||||
<?php while ($photo_query->have_posts()) : $photo_query->the_post(); ?>
|
||||
<a href="<?php the_permalink(); ?>" class="gallery-item">
|
||||
<div class="gallery-placeholder">
|
||||
<?php if (has_post_thumbnail()) : ?>
|
||||
<?php the_post_thumbnail('medium', array('alt' => get_the_title())); ?>
|
||||
<?php else : ?>
|
||||
<span>空笺</span>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="gallery-caption">
|
||||
<?php the_title(); ?>
|
||||
· <?php the_author_meta('display_name'); ?>
|
||||
</div>
|
||||
</a>
|
||||
<?php endwhile; ?>
|
||||
</div>
|
||||
<?php wp_reset_postdata(); ?>
|
||||
<?php else : ?>
|
||||
<p style="color:var(--ink-lighter);text-align:center;padding:60px 0;">尚无光影,敬请期待</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php get_footer(); ?>
|
||||
Reference in New Issue
Block a user