#92773 Adjust URL from the logo
Tom Kellersohn 1 year, 2 months ago
how can the link behind the logo be adapted for special pages? I would like the visitor, after clicking on the logo on page “X”, to go to page “Y” instead of the homepage.
Is there a possibility for this?
Thanks a lot & best regards,
ManuelNodari Support Team 1 year, 2 months ago
Well, this is possible in header builder, you can create a custom header and when you add a logo you can link it to anything you want 🙂
Hope it helps but if you need something else let me knowTom Kellersohn 1 year, 2 months ago
I would prefer a php snippet. To rebuild the header in the header builder afterwards would take too much time.
Could you possibly help me with this?Nodari Support Team 1 year, 2 months ago
Can you provide url of your website? let’s try a snippet of Js first 😉PrivateTom Kellersohn 1 year, 2 months agoThis reply has been marked as private.Amir Rather Support Team 1 year, 2 months ago
You can try my JS below (add to Theme Options > Advanced > Custom JS ) :
jQuery('.header-style-1.header-align-left .header-logo a').attr("href","New-url");
RegardsPrivateTom Kellersohn 1 year, 2 months agoThis reply has been marked as private.Tom Kellersohn 1 year, 2 months ago
Or do I have to enter as “href” the website on which I want to place the special link and as “New-Url” the target URL?Amir Rather Support Team 1 year, 2 months ago
You can use the https://themes.artbees.net/docs/inspecting-elements/ and find that pages id like https://take.ms/vlBJt
Then the code would be like foe example,
jQuery('.page-id-46 .header-style-1.header-align-left .header-logo a').attr("href","New-url");
RegardsTom Kellersohn 1 year, 2 months ago
Works perfectly, thank you very much!Alexander Hutsol Support Team 1 year, 2 months ago
You are welcome 🙂
Feel free to create a new topic if you have any other questions.
Regards.Tom Kellersohn 5 days, 14 hours ago
how can I customise the link from the logo for a specific post only? Is it then theoretically only:
jQuery(‘.post-id-1234 .header-style-1.header-align-left .header-logo a’).attr(“href”,”/my-custom-link/”);
If so, unfortunately it does not work like that. Do you have a tip for me?
Thank you & regards,
ManuelAmir Rather Support Team 5 days, 13 hours ago
Yes, each post has its postid just like pageid’s so this is possible for Posts as well:
jQuery('.post-id-46 .header-style-1.header-align-left .header-logo a').attr("href","New-url");
If you could provide one post URL, we can provide you with the correct JS for that as an example.
RegardsPrivateTom Kellersohn 4 days, 18 hours agoThis reply has been marked as private.Tom Kellersohn 4 days, 18 hours ago
Attached is a screenshot of the code:Amir Rather Support Team 4 days, 15 hours ago
This wasn’t working because the id is postid-5803 it doesn’t have a hyphen between post and id.
Please check now.
RegardsTom Kellersohn 4 days, 14 hours ago
Yes, now it works. Thank you!Amir Rather Support Team 4 days, 14 hours ago
You’re most welcome Tom 🙂