3
我是WordPress新手,在檔案頁面上使用BlankSlate廣告模板我想顯示插入到帖子中的圖像的縮略圖,我該怎麼做?這是我的archives.php代碼。將縮略圖添加到檔案頁面
在此先感謝!
<?php the_post(); ?>
<?php if (is_day()) : ?>
<h1 class="page-title"><?php printf(__('Daily Archives: %s', 'blankslate'), '<span>' . get_the_time(get_option('date_format')) . '</span>') ?></h1>
<?php elseif (is_month()) : ?>
<h1 class="page-title"><?php printf(__('Monthly Archives: %s', 'blankslate'), '<span>' . get_the_time('F Y') . '</span>') ?></h1>
<?php elseif (is_year()) : ?>
<h1 class="page-title"><?php printf(__('Yearly Archives: %s', 'blankslate'), '<span>' . get_the_time('Y') . '</span>') ?></h1>
<?php elseif (isset($_GET['paged']) && !empty($_GET['paged'])) : ?>
<h1 class="page-title"><?php _e('Blog Archives', 'blankslate'); ?></h1>
<?php endif; ?>
<?php rewind_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
<?php get_template_part('entry'); ?>
<?php endwhile; ?>
這取決於你想要的縮略圖顯示出來。您可能需要編輯entry.php。儘管無論哪種方式,你都可能需要使用'the_post_thumbnail()'和'has_post_thumbnail()' – Jrod