下面是我的代码,其中所有内容都正常工作,除了单击“阅读更多”按钮时,它什么也不做
<?php get_header() ; ?>
<section class="container">
<div class="row">
<div class="col-sm-8">
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<article class="blog">
<div class="blog-meta">
<h2 class="blog-meta-title"><a href="<?php the_permalink() ; ?>"><?php the_title() ; ?></a></h2>
<p class="blog-meta-detail">
Posted by <?php the_author_posts_link(); ?>
on <?php the_time(\'F j, Y\'); ?>
Category <?php the_category(\', \') ; ?>
Tag <?php if ( is_tag() ) {
the_tags(\'\',\', \',\'\');
} else {
echo("No Tags Found");
} ?>
</p>
</div> <!-- .blog-meta -->
<?php if ( has_post_thumbnail() ) : ?>
<div class="blog-img">
<?php the_post_thumbnail(\'full\',array(
\'class\' => \'img-responsive\',
)); ?>
</div> <!-- .blog-img -->
<?php endif ; ?> <!-- if ends here of thumbnail -->
<div class="blog-excerpt">
<?php the_excerpt() ; ?>
</div> <!-- .blog-excerpt -->
<div class="blog-more">
<button class="btn btn-primary" href="<?php the_permalink() ; ?>">Read More</button>
</div> <!-- .blog-more -->
<div class="blog-hr">
<hr>
</div> <!-- .blog-hr -->
</article> <!-- .blog -->
<?php endwhile; else : ?> <!-- while ends here of post loop and else starts -->
<article class="blog">
<p><?php _e( \'Sorry, no posts found yo can always start writing\' ); ?></p>
</article> <!-- .blog -->
<?php endif; ?> <!-- if ends here post loop -->
</div> <!-- .col-sm-8 -->
<div class="col-sm-4">
<?php get_sidebar() ; ?>
</div> <!-- .col-sm-4 -->
</div> <!-- .row -->
</section> <!-- .container -->
<?php get_footer() ; ?>
看起来dev-in-dev-tool-also-link在“阅读更多”按钮上正确显示
提前感谢您的帮助。
最合适的回答,由SO网友:Ravi Shinde 整理而成
我已经检查了你的代码和网站。
只需在“阅读更多”的代码中将“按钮”替换为“a href”,就可以了。尝试以下代码-
<a class="btn btn-primary" href="https://project11-cannelflow1.c9users.io/2017/01/17/hello-world/">Read More</a>