標籤存檔: shortcode

WordPress 添加自定義代碼

修改functions.php檔

加入:
function get_word($atts) {return 'Hello I am Dorigo';}
add_shortcode('hello', 'get_word');

之後在文章中輸入[hello]

就會顯示Hello I am Dorigo

可以用在廣告代碼顯示^^