generate_logo

generate_logo

The generate_logo filter allows you to change your logo.

Default (URL): Your logo set in Customize > Site Identity.

Usage

Please refer to the Using Filters article to learn how to use this filter.

Examples

If you want to show a different logo inside categories, you could do this:

add_filter( 'generate_logo', function( $logo ) {
// Return our category logo URL
if ( is_category() ) {
return 'URL TO YOUR CATEGORY LOGO';
}

// Otherwise, return our default logo
return $logo;
} );

If you want to show a different logo for different languages, you could do this:

add_filter( 'generate_logo', function( $logo ) {
if ( ICL_LANGUAGE_CODE == 'en' ) {
return 'URL TO ENGLISH LOGO';
}

return $logo;
} );

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注