[Resolved] replace logo login

Home Forums Support [Resolved] replace logo login

Home Forums Support replace logo login

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #885103
    Sebastien

    hey
    I would like use this code:

        // changing the login page URL
        function put_my_url(){
        return ('HTTP://WWW.YOUR-DOMAIN.COM/'); // putting my URL in place of the WordPress one
        }
        add_filter('login_headerurl', 'put_my_url');
    
        // changing the login page URL hover text
        function put_my_title(){
        return ('NAME OF YOUR WEBSITE'); // changing the title from "Powered by WordPress" to whatever you wish
        }
        add_filter('login_headertitle', 'put_my_title');

    but I would like to replace put_my_title ; put_my_url ; http://WWW.YOUR-DOMAIN.COM/ by the values I’ve already saved in my Theme.
    The aim is to generate the login’s logo-title-url directly with the theme’s datas.
    could you help me? where can I find this kind of doc?

    #885386
    Sebastien

    up: any ETA for theme update?? =)

    #885702
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Just to confirm, are you wanting to use the logo you added in the Customizer as the login logo?

    #886107
    Sebastien

    Hi Tom,

    Yes I want use :
    * the logo added in the customizer as login logo
    * the title added in the customizer as text when hover the login logo
    * the link of my website (font-end / home) as link when clicking onto the login logo

    thanks for interest !

    Another try:
    Can we expect GP theme update in days, weeks, months? πŸ™‚

    #886774
    Tom
    Lead Developer
    Lead Developer

    Try this:

    add_filter( 'login_headerurl', function() {
        return site_url();
    } );
        
    add_filter('login_headertitle', function() {
        return get_bloginfo( 'name' );
    } );
    
    add_action( 'login_enqueue_scripts', function() {
        $logo = wp_get_attachment_image_src( get_theme_mod( 'custom_logo' ), 'full' );
        $logo_url = $logo[0];
        ?>
        <style type="text/css">
            #login h1 a, .login h1 a {
                background-image: url(<?php echo $logo_url; ?>);
    		height:65px;
    		width:320px;
    		background-size: 320px 65px;
    		background-repeat: no-repeat;
            }
        </style>
        <?php 
    } );

    For the logo, you need to adjust the height, width and background-size.

    We’re a couple weeks away from a beta theme version.

    #886791
    Sebastien

    thanks you so much for the code and for the information about the ETA !
    it helps me to take the good decision πŸ˜‰

    #886935
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

    #940170
    Matt

    Hi,

    https://generatepress.com/forums/topic/replace-logo-login/#post-886774

    Does this code need to be added via a hook? Or using a code snippets plugin?

    Cheers,
    Matt

    #940327
    David
    Staff
    Customer Support

    Hi there,

    it needs to be added to the Code Snippets plugin or your Child Theme functions.php if you have one.

Viewing 9 posts - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.