我使用<?php echo get_the_date( 'd.m.Y' ); ?>
在我的其他页面上显示日期,但是我已经干掉了the_time()l,the_date()等等。这些似乎都不能在我的帖子中显示日期。
我使用wp_query来显示帖子,但我无法显示日期。有没有人有解决方案?
<?php
$args = array(
'posts_per_page' => '-1',
'post_type' => 'post',
'post_status' => 'publish',
'category__in' => $quicksand_categories
);
$query = new WP_Query( $args );
foreach ($query->posts as $item) {
$categories = wp_get_post_categories($item->ID);
?>
<li id="item" class="item" data-id="id-<?php echo $item->ID ?>" data-type="<?php foreach ($categories as $c) { echo $c . ' ';}?>" >
<div class="article_info">
<h3>
<?php if(get_option('titles') == 'yes') { ?>
<a href="<?php echo get_permalink($item->ID); ?>">
<?php echo get_the_title($item->ID); ?>
</a>
<?php } ?>
/ <?php $cat_id = $c; $cat_name = get_cat_name( $cat_id ); echo $cat_name;?>
</h3>
<span class="post_date"><?php echo get_the_date( 'd.m.Y' ); ?></span>
</div>
<?php if (get_option('featured') == 'yes') { ?>
<a href="<?php echo get_permalink($item->ID); ?>">
<?php echo get_the_post_thumbnail($item->ID,'full'); ?></a>
<?php } ?>
<br />
<p><?php $post = get_post($item->ID); echo $post->post_excerpt; ?></p>
<a href="<?php echo get_permalink($item->ID); ?>">
<img src="<?php bloginfo('template_url');?>/images/viemore_photos.png" alt="View More photos"/>
</a>
</li>
<?php } ?>