I wrote this code, but when I set the page where I write this code as a posts page from the dashboad, then viewed it on the browser. it has become empty, although I puplished one post. what is wrong with this code, please?
<?php
if (have_posts()) :
while (have_posts()): the_post(); ?>
<div class="col-md-7 col-lg-8">
<div class="mb-50 mb-sm-30">
<div class="pos-relative mb-30 pt-15">
<div class="font-8 abs-tl p-20 bg-primary color-white">
<?php if(has_post_thumbnail()) : ?>
<img src="<?php the_post_thumbnail_url(); ?>" alt="">
<?php endif; ?>
</div>
<h4><a href="<?php the_permalink(); ?>"><b> <?php the_title(); ?> </b></a></h4>
<h6 class="mt-10 bg-lite-blue dplay-inl-block">
<a class="plr-20 mtb-10" href="#"><b>By <?php the_author_posts_link(); ?></b></a>
<a class="plr-20 mtb-10 brder-lr-lite-black-2" href="#"><b>in <?php the_category( ', ' ); ?></b></a>
<a class="plr-20 mtb-10" href="#"><b> <?php comments_popup_link('0 comments'); ?> </b></a>
</h6>
<p class="mt-30"> <?php the_excerpt(); ?> </p>
</div><!--mb-30-->
<?php endwhile;
endif; ?>
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1742404780a4437624.html
评论列表(0条)