2011-03-07 87 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