2017-03-07 109 views

回答

1

短代碼在WordPress的定義喜歡這樣的:

//[foobar] 
function foobar_func($atts){ 
    return "foo and bar"; 
} 
add_shortcode('foobar', 'foobar_func'); 

https://codex.wordpress.org/Shortcode_API

你必須找到在endfold主題定義的快捷鍵文件(只是grep的簡碼別名)和重新實現你的主題上的代碼。

+0

thanks,mr.void但是我知道如何爲wordpress主題添加短代碼,但是endfold有自己特殊的結構,這讓我很迷惑 – Ali

+0

我認爲他們使用WP-Shortcode API,所以必須定義這些: add_shortcode('foobar','foobar_func'); –

+0

謝謝,我會檢查它 – Ali