2013-10-17 34 views
0

有没有方法可以添加到wordpress摘录的开头?我尝试在作者的姓名这样的补充,所以它的所有文本的同一区块内:Wordpress在摘录开头添加作者姓名

<strong>(<?php echo get_the_author(); ?>) --</strong> Excerpt text.... 

它看起来像:

(AUTHORNAME) -摘录文字。 ...

+0

和问题是什么? – codepixlabs

回答

2
$custom_excerpt = '<strong>('.get_the_author() .') ---</strong>'.get_the_excerpt(); 
echo $custom_excerpt ; 
+0

完美!感谢你! – user1272433

+0

干杯..这很容易 – codepixlabs

0

试试这个函数:the_author();

您refence:http://codex.wordpress.org/Function_Reference/the_author

+0

我没有任何麻烦让作者来显示,我需要添加the_author();或get_the_author(); into the_excerpt();以便它在摘录文本之前和片段中的第一行文本内显示。不过谢谢。 – user1272433