如何显示永久摘录几段
我尝试显示右内永久内/摘录如何显示永久摘录几段
,即时通讯使用在我的主题指定区域的代码之后是此
<div id="headline">
<?php the_excerpt(); echo '<a href="'.get_permalink().'" class="more-link">'; echo '[Read more...]'; echo '</a>';?>
</div>
的结果
<p>the excerpt here</p>
<a>permalink here</a>
我该如何显示段落中显示段落的永久链接?
<p> the_excerpt; <a>permalink</a> </p>
感谢所有。
您可以将下面的代码在你的主题的functions.php的福乐
function new_excerpt_more($more) {
global $post;
return '<a href="'. get_permalink($post->ID) . '">[Read more...]</a>';
}
add_filter('excerpt_more', 'new_excerpt_more');
该手抄本条目有关于如何修改excerpt
吐出什么更多的细节:http://codex.wordpress.org/Function_Reference/the_excerpt
感谢您的回答。很有用。 – 2011-03-07 09:20:50
@mauri没问题。请标记答案是正确的,如果它解决了你的问题:):http://stackoverflow.com/faq#howtoask – JohnP 2011-03-07 10:39:52
我试着上述解决方案,但它并没有解决我的问题,A标签仍然显示在P标签之外。我使用get_the_excerpt()解决了我的问题,它只返回没有P标签的摘录文本。
http://codex.wordpress.org/Function_Reference/get_the_excerpt
这是我想要的'
摘录,永久链接
' – 2011-03-07 08:04:55