我可以在wordpress的這個區域添加一個按鈕嗎?我要編輯的部分的圖片如何在有文本和頁面編輯屏幕的字段中添加帶有 php 的按鈕?我想在按鈕內容中做這樣的事情:<a href="http://example.com/get.php?url=<?php echo $geturl; ?>"> Click here </a>我想將相關帖子/頁面的 URL 分配給 $ geturl 變量。example.com/get.php?url=http://example.com/example-post/我怎樣才能做到這一點 ?謝謝
2 回答

LEATH
TA貢獻1936條經驗 獲得超7個贊
你可以通過在Function.php文件下面添加下面的代碼來修復它(我沒想到這么簡單。我沒想到文本部分的url會用get_permalink();變量打?。?/p>
function custom_meta_box_markup()
{
echo get_permalink();
}
function add_custom_meta_box()
{
add_meta_box("demo-meta-box", "Custom Meta Box", "custom_meta_box_markup", "post", "side", "high", null);
}
add_action("add_meta_boxes", "add_custom_meta_box");
- 2 回答
- 0 關注
- 109 瀏覽
添加回答
舉報
0/150
提交
取消