好日子
我使用的摘录在我的wordpress主题。在wordpress的文档中,他们说wordpress不会自动添加摘录的链接,您必须手动添加链接,如下所示:
原始摘录文件
<div class="content">
<?php the_excerpt(); ?>
</div>添加链接
<div class="content">
<?php the_excerpt(); ?>
<a href="<?php echo get_permalink(); ?>"> Read More...</a>
</div>现在,我想要做的是将每个节选链接到不同的wordpress 页面,而不是链接到它自己的节选。为此,我必须创建一个自定义php函数,以便为每个节选创建一个唯一的链接,每个链接指向一个不同的页面。我该怎么做?
请看我的网站摘录的位置-它就在下面的主要滑块命名:牧师角,母亲的心,布道等.
谢谢
发布于 2013-02-24 06:11:46
您可以将ID传递给get_permalink,以便为不同的帖子或页面提取permalink。
<a href="<?php echo get_permalink($post_id); ?>"> Read More...</a>https://stackoverflow.com/questions/15044679
复制相似问题