2012-11-24 21 views
0

我正在製作一個WordPress博客,我不得不經常更改網站URL進行測試。有沒有一種有效的方式來將博客的當前主頁URL動態插入到帖子中?在WordPress帖子中使用動態網站網址?

E.g.我想要做這樣的事情:

[button link="[current_site_url]/about/" size="large"]About[/button] 

回答

0

下面是一些例子:

//All these functions return the blog's URL as configured in Settings 
site_url(); // Does not display the URL 
get_bloginfo('url'); // Does not display the URL 
bloginfo('url'); // Always displays the URL 

// Returns the root directory URL 
// For http://example.com/myblog returns http://example.com 
home_url(); // Does not display the URL 
相關問題