Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter aarontimo

    (@aarontimo)

    Can anyone please assist?

    Well, you could either change the HTML in header.php (in a child theme), or you could use some javascript (which you could add in a widget, if each page has one);

    headerImage=document.getElementsByClassName("site-branding")[0];
    headerImage.addEventListener("click",function(){document.location="http://your.url/";},false);

    frank

    Thread Starter aarontimo

    (@aarontimo)

    Hi Frank,

    Thanks for your reply!

    I assume the code you provided is for the javascript option? If so, could this code go in any widget that we have down the side of our site?

    Many thanks!

    Aaron

    That indeed is for the JS-based solution. If you paste this in a text-widget (and if that text-widget is on every page), this should work.

    frank

    Thread Starter aarontimo

    (@aarontimo)

    Thanks Frank. The only widget I can add code to is the ‘text’ widget, and then the code appears down the side of the site (and the header still isn’t clickable). Should I put ‘<>’ around the code so the site detects it as code?

    Many thanks

    Aaron

    Hi Aaron;
    You should put the code between script-tags, like this;

    <script>
    headerImage=document.getElementsByClassName("site-branding")[0];
    headerImage.addEventListener("click",function(){document.location="http://your.url/";},false);
    </script>

    have a nice weekend,
    frank

    Thread Starter aarontimo

    (@aarontimo)

    Thank you so incredibly much Frank – that worked!!

    I really appreciate your help.

    Aaron

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Clickable header image to return to home screen’ is closed to new replies.