1
对不起,我对WordPress编码和从零开始学习它很新。请原谅我缺乏经验。日期基础档案在WordPress主页
我有一个自定义后类型,称为“产品”,并希望只显示他们在网页上的日期基于归档。但是,我不想显示帖子标题或帖子中的任何其他内容,但该日期前三到四个帖子中的内容除外。事情是这样的:
我想下面的代码,但它返回的职位为正常循环。
<?php $query = new WP_Query(array('post_type' => 'products', 'orderby' => 'date')); ?>
<?php if ($query->have_posts()) : ?>
<?php /* Start the Loop */ ?>
<?php while ($query->have_posts()) : $query->the_post(); ?>
<article id="post-<?php the_ID(); ?>" <?php post_class(); ?>>
<?php
$archive_year = get_the_time('Y');
$archive_month = get_the_time('m');
$archive_day = get_the_time('d');
?>
<div class="idpostdate">
<a href="<?php echo get_day_link($archive_year, $archive_month, $archive_day); ?>"><?php the_date('F j, Y', '', '<span class="datetext">: Click Here To View Products</span>', true);?></a>
</div>
<div class="thumbnail">
<?php if (has_post_thumbnail()) { the_post_thumbnail('homet'); } ?>
</article>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part('no-results', 'index'); ?>
<?php endif; ?>
任何指导?