Menu: open external Links diretly in same tab
-
Hey Guys,
im trying to build up a menu for my homepage. When I include external links, they will be opened in a new tab. Is there a way to open them directly in the same tab?Best
huhno
-
Ola @huhno
no. Unfortunately not.You could write a little jQuery which add the attribute
target="_blank"
to the link.All the best!
Marius
-
alright, thanks! as I'm a bloody beginner in all of this...could you tell me what exactly i could do?
-
-
-
Dear @huhno
nothing to worry about. Great that you build websites with Laytheme already.I write that for you:
window.laytheme.on("newpage", function(layoutObj, type, obj){ jQuery('a[target="_blank"]').removeAttr('target'); });
Hope I could help!
Please note that this is for ALL external links now.
Best!
Marius
-
hey @mariusjopen ,
thanks for your answer. I think I don't know where to put that code...any hints? -
1/8
I also code custom websites or custom Lay features.
💿 Email me here: 💿
info@laytheme.com
Before you post:
- When using a WordPress Cache plugin, disable it or clear your cache.
- Update Lay Theme and all Lay Theme Addons
- Disable all Plugins
- Go to Lay Options → Custom CSS & HTML, click "Turn Off All Custom Code", click "Save Changes"
This often solves issues you might run into
When you post:
- Post a link to where the problem is
- Does the problem happen on Chrome, Firefox, Safari or iPhone or Android?
- If the problem is difficult to explain, post screenshots / link to a video to explain it