change URL associated with Logo in Header

This site uses cookies. By continuing to browse this site, you are agreeing to our Cookie Policy.

  • Hi,

    this is hardcoded and always refer to the homepage of the site.

    If you like to change this, this can only be done with a child theme and overwriting the parent header class.

    This is from an other thread about this topic:


    Hi,

    the theme header file is not loaded dynamically. So making a copy inside the child theme does not work in this case.

    Apply this change here. I already added it to the theme update, so it won't be lost on next update.

    In parent theme edit unite-custom/ut-theme-header.php

    find :

    PHP Source Code

    1. <a class="<?php echo implode(' ', $logo_class ); ?>" href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">


    and exchange it with:

    PHP Source Code

    1. <a class="<?php echo implode(' ', $logo_class ); ?>" href="<?php echo esc_url( apply_filters( 'ut_site_logo_url', home_url( '/' ) ) ); ?>" rel="home">
    and then a few lines below:

    PHP Source Code

    1. <a href="<?php echo esc_url( home_url( '/' ) ); ?>" rel="home">
    with:

    PHP Source Code

    1. <a href="<?php echo esc_url( apply_filters( 'ut_site_logo_url', home_url( '/' ) ) ); ?>" rel="home">

    Once done you can now overwrite the URL with your own one with this function you can place inside the child theme functions.php

    An example function would be:

    Source Code

    1. add_filter( 'ut_site_logo_url' , function() { return 'http://www.mynewurl.com'; } );

    Hope this helps :)
    Support Times: Monday to Friday (Central European Time)
    Response Time: 12-48 hours (depending on workload)
    Please, do not send any private messages before I have asked for!
  • Hi,

    no in this case the logo URL will automatically change - the LOGO will always point to the page which is set to be the "Page on Front" under Settings > Reading
    Support Times: Monday to Friday (Central European Time)
    Response Time: 12-48 hours (depending on workload)
    Please, do not send any private messages before I have asked for!