Tutorial Example

A Beginner’s Guide to Get WordPress Home, Theme and Plugin URL – WordPress Tutorial

When we are developing wordpress theme, we often need wordpress home, theme and plugin url. In this tutorial, we will introduce how to get these urls for you.

Get wordpress home url

<?php
echo get_bloginfo('url');
?>

The home url likes: https://www.tutorialexample.com

You also can use home_url() function to get wordpress home url.

Understand WordPress home_url() for Beginngers – WordPress Tutorial

Get wordpress theme url

<?php
echo get_bloginfo('template_directory');
?>

The theme url likes: https://www.tutorialexample.com/wp-content/themes/iconic-one

Get wordpress plugin url

<?php
echo plugins_url();
?>

The wordpress plugin url likes: https://www.tutorialexample.com/wp-content/plugins