wordpress url functions

By Published On: May 27, 2011

There are many url functions in wordpress which will tell you what is the address of different directories in wordpress. Let me discuss each of these:- plugins_url() gives you address of plugins directory. For example http://www.yoursite.com/wp-content/plugins includes_url() gives you address of wp-includes directory. For example http://www.yoursite.com/wp-includes content_url() gives you address of wp-content directory. For example http://www.yoursite.com/wp-content admin_url() gives you address of wp-admin directory. For example http://www.yoursite.com/wp-admin site_url() gives [...]


There are many url functions in wordpress which will tell you what is the address of different directories in wordpress.

wordpress url function

wordpress url function

Let me discuss each of these:-
plugins_url() gives you address of plugins directory. For example http://www.yoursite.com/wp-content/plugins
includes_url() gives you address of wp-includes directory. For example http://www.yoursite.com/wp-includes
content_url() gives you address of wp-content directory. For example http://www.yoursite.com/wp-content
admin_url() gives you address of wp-admin directory. For example http://www.yoursite.com/wp-admin
site_url() gives you address of your site. For example http://www.yoursite.com
home_url() gives you address of your site. For example http://www.yoursite.com
There is slight difference between site_url() and home_url(). Suppose you have saved your core files in wp directory and you want that your website address should be http://www.yoursite.com not http://www.yoursite.com/wp then the home_url() value will be http://www.yoursite.com and it is saved in wp-options table.


Share this article

Written by : Junaid Rehman

I am a blogger and freelance web developer by profession. I love to blog and learn new things about programming and IT World.

Follow us

A quick overview of the topics covered in this article.

Join our website

Our partner website gives you a good reading experience

Latest articles