wordpress set favicon code example

Example 1: wordpress change favicon

1. Log in to your WordPress website.
2. Click on ‘Appearance’ -> ‘Customize’.
3. Click on ‘Site Identity’.
4. Here you can define your site name, tagline, logo, and icon. The image you 
set under “Site Icon” will be used as your site’s favicon.

reference :
https://yoast.com/how-to-change-your-favicon-in-wordpress-a-step-by-step-guide/

Example 2: how to add site logo in wordpress

function themename_custom_logo_setup() {
 $defaults = array(
 'height'      => 100,
 'width'       => 400,
 'flex-height' => true,
 'flex-width'  => true,
 'header-text' => array( 'site-title', 'site-description' ),
 );
 add_theme_support( 'custom-logo', $defaults );
}
add_action( 'after_setup_theme', 'themename_custom_logo_setup' );

Tags:

Go Example