Wordpress在摘录开头添加作者姓名

时间:2013-10-17 17:30:11

标签: php wordpress

有没有办法在wordpress中添加到摘录的开头?我试着像这样添加作者的名字,所以它都在同一个文本块中:

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

看起来像是:

(作者姓名) - 摘录文字.....

2 个答案:

答案 0 :(得分:2)

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

答案 1 :(得分:0)

尝试此功能:the_author();

供您参考:http://codex.wordpress.org/Function_Reference/the_author