Site logo

Display the site logo that is set in the customizer Site identity section.

Site logo action can be added on <a>, <img> and <svg> elements.

Modes

The action behaves in two different ways, depending on where it is placed:

On <a> element

It replaces the whole element with the output of WordPress get_custom_logo() function. Classes and other attributes are not preserved. The output is the logo wrapped in a link to the site home.

On <img> element

The action displays the site logo on the image, changing only the src attribute. All other attributes are preserved.

On <svg> element

The element is changed to <img> and the site logo is displayed on it. Attributes alt, style, class, aria* and id are preserved.

Configuring the theme

The theme needs to have the site logo support declared with:

add_theme_support( 'custom-logo' );

In projects started with Pinegrow 6.2 and above, generated functions.php includes the statement by default.

Use WordPress -> Regenerate functions.php to re-generate functions.php on older project. Note that any custom additions to the file will be lost.



Last updated on November 15, 2021 at 7:10 am


Print this article