get_bloginfo

Home » Functions » get_bloginfo

WordPress offers a wide range of functions that developers can use to improve their website’s functionality. One such function is the get_bloginfo() function. It is a simple function that returns information about the current site, such as the name, description, and URL.

The get_bloginfo() function is a versatile tool that can be used to display specific information about a website wherever necessary. It can be used for a wide range of purposes, such as creating custom meta tags, displaying the site’s name in the footer, or showing the site’s URL in a contact form.

The function is used by passing in a specific parameter that determines what information should be returned. For example, the following code would return the name of the website:

$site_name = get_bloginfo('name');
echo $site_name;

In this case, the get_bloginfo() function is called with the ‘name’ parameter, which tells it to return the name of the website. The returned value is then stored in the $site_name variable, which is printed to the screen using the echo statement.

Overall, the get_bloginfo() function is a simple yet versatile tool that can be used to retrieve information about a WordPress site whenever needed.

Learn More on WordPress.org

Register an account to save your snippets or go Pro to get more features.