最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

posts - Wordpress empty page! what is wrong with this code?

programmeradmin0浏览0评论

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; ?>


发布评论

评论列表(0)

  1. 暂无评论