Tuesday, June 9, 2015

Default WordPress function to get the URL information



Some of the default WordPress function to get the URL information
  •  plugins_url() — Full plugin directory URL (for example, http://php999.blogspot.com/wp-content/plugins)
  •  includes_url() — Full includes directory URL (for example, http://php999.blogspot.com/wp-includes)
  •  content_url() — Full content directory URL (for example, http://php999.blogspot.com/wp-content)
  •  admin_url() — Full admin URL (for example, http://php999.blogspot.com/wp-admin/)
  •  site_url() — Site URL for the current site (for example, http://php999.blogspot.com)
  •  home_url() — Home URL for the current site (for example, http://php999.blogspot.com)
Confused by seeing site_url and home_url?

Here is the explanation. Site_url() will give your exact blog address and home_url() will give you the domain address.
Consider this example, we have hosted our wordpress blog in http://php999.blogspot.com/blog/index.php

Site_url returns => http://php999.blogspot.com/blog
Home_url returns => http://php999.blogspot.com

1 comment:


  1. Hello,

    we provide affordable and result-oriented SEO services, please give a chance to serve you.


    Thanks
    Admin: E07.net

    ReplyDelete

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide

How to Host a Laravel Project on Hostinger’s hPanel: A Step-by-Step Guide If you're looking to host a Laravel project on Hostinger’s hPa...