Aleš Sýkora wrote

Change WordPress login logo with code

6. 11. 2020 in

Need to change wordpress login logo? Use this code in custom plugin or in Code Snippets plugin. Change the background image url to your image and Link Title to your site name for example.

//Custom logo change

function login_logo() { ?>
    <style type="text/css">
        #login h1 a, .login h1 a {
            background-image: url(https://www.domain.com/wp-content/uploads/logo.svg);
}
    </style>
<?php }
add_action( 'login_enqueue_scripts', 'login_logo' );

//Custom logo URL

function login_logo_url() {
    return home_url();
}
add_filter( 'login_headerurl', 'login_logo_url' );
function login_logo_url_title() {
    return 'Link title';
}
add_filter( 'login_headertitle', 'login_logo_url_title' );

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.

More from category
Aleš Sýkora wrote
Disable Astra Theme Next/previous Post link
11. 7. 2019 in
Disable Next/Previous Post in Astra Theme.
Read More
Aleš Sýkora wrote
Toggle Table Row with jQuery (usable in Toolset)
31. 12. 2019 in
If you want toggle to open a new row in the table, then you need to use some jQuery with Toolset again. First – create the table (you can use it in view, content tempate, etc.). All credit for this example goes to jsfiddle: http://jsfiddle.net/GqS7W/. And use it with this jQuery script. Do not forget […]
Read More
Aleš Sýkora wrote
Modify ‘ASAP’ label in Iconic Delivery Slots
5. 1. 2021 in
You can use this code snippet to change the label for 'ASAP' when using ASAP delivery.
Read More
magnifiercross linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram