• I have a WP-powered blog (blog.qoorp.se) as an auxiliary to my main site (qoorp.se). I want users who click on the company logo on the blog to get to the main site (qoorp.se), not the main page of the blog (blog.qoorp.se). However, as I am using the twentysixteen theme, the logo automatically points to the blog’s main site, and there is no apparent way to edit the link whereto the logo points. How can this be done?panel view

Viewing 1 replies (of 1 total)
  • You can try dding this to your functions.php. It should replace the link with “https://YOURSITE.url” (please adjust this in the code)

    
    add_filter( 'get_custom_logo', 'wecodeart_com' );
    // Filter the output of logo to fix Googles Error about itemprop logo
    function wecodeart_com($html) {
        $custom_logo_id = get_theme_mod( 'custom_logo' );
        if ($custom_logo_id){
            $html = sprintf( '<a href="%s" rel="home">%s</a>',
                'https://YOURSITE.url',
                wp_get_attachment_image( $custom_logo_id, 'full', false, array(
                    'class'    => 'custom-logo',
                ) )
              );
          }
        return $html;   
    }
    

    This is untested, but it shows the direction you should go. It only works when an image is actually uploaded (see if clause). Here is the link to the function.

    • This reply was modified 7 years, 10 months ago by gnoric.
    • This reply was modified 7 years, 10 months ago by gnoric.
Viewing 1 replies (of 1 total)
  • The topic ‘Make logo point to main site, not blog’ is closed to new replies.