• Resolved destincj

    (@destincj)


    Hi,

    I have your theme downloaded on my website. I can’t find how to change where the logo links to in the theme folder. Is there anyway to customize where the logo on the site links to?

    I want it to link to my newsfeed.

    The page I need help with: [log in to see the link]

Viewing 3 replies - 1 through 3 (of 3 total)
  • AddWeb Solution

    (@addweb-solution-pvt-ltd)

    Hello destincj,

    To change the link on the logo then first back up the file header-hooks.php inside your theme folder, then edit the file header-hooks.php, go to the line no. 213
    <?php the_custom_logo(); ?>
    change this with your desired logo with link using html

    Hope this will helps you.

    Thanks.

    Theme Author ZeeTheme

    (@zeetheme)

    Hello guys,

    Thanks @addweb-solution-pvt-ltd for contributing to the topic. Your solution is correct.
    But it will be better not to hardcode the url to the theme.

    So here is a better solution.

    add_filter( 'get_custom_logo',  'custom_logo_url' );
    function custom_logo_url ( $html ) {
    
    $custom_logo_id = get_theme_mod( 'custom_logo' );
    //Your Custom URL
    $url = 'www.mysiteurl.com'; //Replace the URL with your own.
    $html = sprintf( '<a href="%1$s" class="custom-logo-link" rel="home" itemprop="url">%2$s</a>',
            esc_url( $url  ),
            wp_get_attachment_image( $custom_logo_id, 'full', false, array(
                'class'    => 'custom-logo',
            ) )
        );
    return $html;    
    }

    You need to replace the url – https://www.mysiteurl.com in line number 5 with your own url and it’s done.

    Read this article to know the correct way to add a code snippet to the theme – https://whitedot-docs.zeetheme.com/docs/developers/adding-php/

    Let me know if the problem is solved.

    Thank you both for using WhiteDot.

    • This reply was modified 5 years, 11 months ago by ZeeTheme.
    Theme Author ZeeTheme

    (@zeetheme)

    You have not replied for 6 days. Looks like your issue is solved.
    I am Marking this topic as resolved.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Redirect Logo to custom page’ is closed to new replies.