有没有办法在wordpress中添加到摘录的开头?我试着像这样添加作者的名字,所以它都在同一个文本块中:
<strong>(<?php echo get_the_author(); ?>) --</strong> Excerpt text....
看起来像是:
(作者姓名) - 摘录文字.....
答案 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