Displaying the site name or description in WordPress

Looking to display the site name or description in your WordPress theme? All you need to call is the bloginfo() function.

Using bloginfo() to display site information

In order to display the site name, you should the bloginfo() function, as per the below example.

bloginfo( 'name' ); // Returns the site name without the use of the echo() function

echo get_bloginfo( 'name' ); // Echos the site name rather than returning as default

In order to display the site description (also referred to as the site tagline), you should call the function as per the below example.

bloginfo( 'description' ); // Returns the site description without the use of the echo() function

echo get_bloginfo( 'description' ); // Echos the site description rather than returning as default