• Resolved sweetsyl

    (@sweetsyl)


    Hello everyone,

    I am contacting you because I would like to remove the link to the home page from the logo on the header of a speific page. If this is not possible i would be happy to have the link removed from all the pages.

    Unfortunately I cannot provide a link to my website because it’s on maintenance mode.

    Could anyone help me please?
    At the moment i don’t have any other modifications to the css.

    Thank you and kind regards

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hello @sweetsyl,

    Thank you for trying Neve out.

    I understand you would like to remove the link from the logo located on the header’s navigation bar.

    This can be achieved using this JS code:

    <script type = "text/javascript" >
        window.addEventListener('DOMContentLoaded', (event) => {
            var logo = document.querySelector('body.blog nav#cb-row--header-main .builder-item--logo .site-logo');
            if (logo.firstElementChild.tagName == "A" && logo.firstElementChild.className == "brand") {
                logo.firstElementChild.removeAttribute("href");
            }
        }); 
    </script>

    This particular code is removing the link from the logo on the blog page. You can replace the “body.blog” part from the first line of code to the page you would like to remove the link from. In order to determine what to add instead of “body.blog”, you need to right-click on the logo and press Inspect. The first class of the body tag is usually the page type as you can see here -> https://prntscr.com/njg0m4

    This code can be added to your website using any Scripts plugin you would like.

    I usually use this plugin: Header and Footer Scripts.

    After installing and activating this plugin, you will need to navigate to Settings -> Header and Footer Scripts and you should be able to notice something like this -> https://prntscr.com/njddn7

    In the text field where it says Footer scripts, you need to add the code above.

    Please let us know if you succeed.

    Thread Starter sweetsyl

    (@sweetsyl)

    hello and thank you for your quick email. I had difficulties finding the page id,, I was wondering if maybe it would be quicker and easier to remove the link on all the pages? Could you help me with that please?

    Hi @sweetsyl,

    You can easily add a logo image with a different link using the new header builder included in Neve.
    You’ll just need to go to Appearance > Customize > Header, remove the Logo & Site Identity component, and replace it with the HTML component. There you can add a code similar to this one:
    <a href="#"><img src="https://localhost/wordpress-new/wp-content/uploads/2019/04/neve-logo-imgtext-1.png" style="width:100px;"></a>
    where you can replace # with your link and for the image source you need to upload the image in your library and get the attachment URL https://prnt.sc/njxil7
    Let me know if you manage to do that.

    Regards,
    Rodica

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘remove link from logo to home from 1 specific page’ is closed to new replies.