Title: _custom_logo_header_styles
Published: April 12, 2016
Last modified: August 20, 2026

---

# _custom_logo_header_styles()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#changelog)

This function’s access is marked private. This means it is not intended for use 
by plugin or theme developers, only by core. It is listed here for completeness.

Adds CSS to hide header text for custom logo, based on Customizer setting.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#source)󠁿

    ```php
    function _custom_logo_header_styles() {
    	if ( ! current_theme_supports( 'custom-header', 'header-text' )
    		&& get_theme_support( 'custom-logo', 'header-text' )
    		&& ! get_theme_mod( 'header_text', true )
    	) {
    		$classes = (array) get_theme_support( 'custom-logo', 'header-text' );
    		$classes = array_map( 'sanitize_html_class', $classes );
    		$classes = '.' . implode( ', .', $classes );
    		?>
    		<!-- Custom Logo: hide header text -->
    		<style id="custom-logo-css">
    			<?php echo $classes; ?> {
    				position: absolute;
    				clip-path: inset(50%);
    			}
    		</style>
    		<?php
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/theme.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.1/src/wp-includes/theme.php#L2993)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.1/src/wp-includes/theme.php#L2993-L3011)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#related)󠁿

| Uses | Description | 
| [get_theme_support()](https://developer.wordpress.org/reference/functions/get_theme_support/)`wp-includes/theme.php` |

Gets the theme support arguments passed when registering that support.

  | 
| [get_theme_mod()](https://developer.wordpress.org/reference/functions/get_theme_mod/)`wp-includes/theme.php` |

Retrieves theme modification value for the active theme.

  | 
| [current_theme_supports()](https://developer.wordpress.org/reference/functions/current_theme_supports/)`wp-includes/theme.php` |

Checks a theme’s support for a given feature.

  |

[Show 1 more](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/_custom_logo_header_styles/?output_format=md#changelog)󠁿

| Version | Description | 
| [4.5.0](https://developer.wordpress.org/reference/since/4.5.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2F_custom_logo_header_styles%2F)
before being able to contribute a note or feedback.