What functions to use to get a URL for WordPress in PHP?

What functions to use to get a URL for WordPress in PHP?

It is very easy to get URL and URI in WordPress, below is the list of most common functions:

plugins_url( $path, $plugin ); returns plugins url and appends $path at the end
get_theme_root(): Returns the address of the theme installation directory
get_template_directory_uri(): Retrieves the URI to the current theme’s files
admin_url(): Provides the address of the WordPress administrative pages
content_url(): Indicates where the wp-content directory can be found
site_url() and home_url(): Return the site address
includes_url(): Provides the location of WordPress include files
ff wp_upload_dir(): Indicates the directory where user-uploaded files are stored

Close Menu