2014-12-11 79 views
0

我在「the_author」上添加了一個過濾器來添加一些帶有作者信息的html代碼。但是,我的所有HTML都是作者鏈接的錨點。對於如:WordPress的作者過濾器

add_filter('the_author', 'myfun'); 
function myfun($content) { 
     $content.= 'hi'; 
     return $content; 
} 

現在,「嗨」,只是它不應該被包含在筆者錨標記一個簡單的文本。請幫忙。

回答

0
add_filter('the_author', 'myfun'); 
add_filter('get_the_author_display_name', 'myfun'); 

function myfun($name) { 
    global $post; 

    if ($name) 
    $name.= '</br>hi'; 


    return $name; 
} 
+0

不,它沒有幫助。雖然我確實設法通過加入「」來解決問題。但我認爲這不是正確的方法。 – 2014-12-13 13:39:20