我有这个链接:
http://www.dg-design.ch/blog/page/2/
PHP 代码:
<?php while ( have_posts() ) : the_post(); ?>
<?php if( $wp_query->current_post == 0 ){ ?>
<li class="block first-post">
<a href="<?php the_permalink(); ?>" class="fancybox-iframe"><?php the_post_thumbnail('vantage-grid-loop'); ?></a>
<h3><a href="<?php the_permalink(); ?>" class="fancybox-iframe"><?php the_title(); ?></a></h3><br><p class="italic"><?php the_date(); ?></p>
<p><?php echo substr(get_the_content(),0,600).'...'; ?></p>
</li>
<?php } else if( $wp_query->current_post > 0 && $wp_query->current_post < 5 ) { ?>
<li class="block">
<a href="<?php the_permalink(); ?>" class="fancybox-iframe"><?php the_post_thumbnail('blog'); ?></a>
<h3><a href="<?php the_permalink(); ?>" class="fancybox-iframe"><?php echo substr(get_the_title(),0,20).'...'; ?></a></h3><br>
<p class="italic"> <?php the_date(); ?></p>
<p><?php echo substr(get_the_content(),0,70).'...'; ?></p>
</li>
<?php } else { ?>
<li class="block">
<a href="<?php the_permalink(); ?>" class="fancybox-iframe"><?php the_post_thumbnail('blog'); ?></a>
<h3><a href="<?php the_permalink(); ?>" class="fancybox-iframe"><?php the_title(); ?></a></h3><br>
<p class="italic"><?php the_date(); ?></p>
<p><?php echo substr(get_the_content(),0,600).'...'; ?></p>
</li>
<?php } ?>
<?php //get_template_part( 'content', get_post_format() ); ?>
<?php endwhile; ?>
我放一张图来更好地理解他们想要什么。
在博客的第一页显示日期,其余页面不显示,不明白为什么。
你能帮我解决这个问题吗?
提前致谢!
最佳答案
请检查屏幕截图并检查设置是否正确。
关于php - 为什么不显示周围时间? WordPress的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30801702/