我在阅读更多按钮中尝试了此代码,我想要页面的链接
<div class="blogleft">
<ul class="eachblog">
<?php while ( have_posts() ) : the_post(); ?>
<li>
<h1>
<?php the_title();?>
</h1>
<div class="perpostbg">
<?php $content = get_the_content(); echo substr($content,0,400); echo '...';?>
<a href="#" class="readmorebutton">Read more</a>
</div>
</li>
<?php endwhile;?>
</ul>
</div>
答案 0 :(得分:0)
使用固定链接
<a href="<?php echo get_permalink(); ?>" class="readmorebutton">Read more</a>
OR
<a href="<?php echo the_permalink(); ?>" class="readmorebutton">Read more</a>
答案 1 :(得分:0)
只需写下
<a href="<?php the_permalink(); ?>" class="readmore">Read more</a>
搜索循环中的此代码