2011-03-07 88 views
0

我尝试显示右内永久内/摘录如何显示永久摘录几段

,即时通讯使用在我的主题指定区域的代码之后是此

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

感谢所有。

+0

这是我想要的'

摘录,永久链接

' – 2011-03-07 08:04:55

回答

1

您可以将下面的代码在你的主题的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

+0

感谢您的回答。很有用。 – 2011-03-07 09:20:50

+0

@mauri没问题。请标记答案是正确的,如果它解决了你的问题:):http://stackoverflow.com/faq#howtoask – JohnP 2011-03-07 10:39:52