Dynamic change logo in wp login page and favicon icon

Here i am defining you how to change the wordpress logo and favicon icon in wordpress login page wp-login.php. If you will customize the page when you will update the wordpress may be changes has been gone. You can do this dynamically change it via functions.php which on theme. open the functions.php file which inside acticated theme folder.

//write function for change favicon icon

function add_at_favicon() {
$favicon_path = get_template_directory_uri() . '/img/favicon.png';
echo '';

//call action hook for load icon.

add_action( 'wp_head', 'add_at_favicon' ); //front end
add_action( 'admin_head', 'add_at_favicon' ); //admin end

//Write function for change logo.
function at_login_logo() { ?>

add_action( 'login_enqueue_scripts', 'at_login_logo' );
//Change URL

function at_login_logo_url() {
return home_url();
add_filter( 'login_headerurl', 'at_login_logo_url' );

Done open wordpres login page and your URL, logo, favicon now showing in your wordpress.Thank you reading wait for next post 🙂

Leave a Comment

Your email address will not be published. Required fields are marked *