开发者

Wordpress plugin to store base URL as variable?

Is there a plugin t开发者_如何学Gohat takes any URLs in the post/page content and stores the base url portion as a variable?

For example, store http://www.mydomain.com/about as {$base_url}about

Would be nice for changing URLs around.


If you don't wish to edit your theme, you can use the URL Shortcodes plugin to produce absolute URLs that you can use in your posts and pages.

  • http://wordpress.org/extend/plugins/url-shortcodes/

Update: If it's to make your WordPress database more portable, you can just use WordPress' native Import/Export functions to bring your content to a new host/domain.

If you need to change all the links in your post content, you can use a plugin like Search and Replace to change the content within your database:

  • http://wordpress.org/extend/plugins/search-and-replace/


I believe what you're looking for is:

echo get_bloginfo('url').'/about';

Correct me if I'm wrong, but you can get all of the bloginfo from that function.

Source: http://codex.wordpress.org/Function_Reference/bloginfo

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜