Archived topic
Open home icon on the same window
11 replies · Started by Kumar on September 21, 2020
Hi
I am using the following code from this topic- https://docs.generatepress.com/article/generate_logo_href/
Using code snippet:
add_filter( 'generate_logo_href', function() {
return "https://www.xyz.com";
} );
But it opens in a new window, can we set it to open in the same window.
Thanks
Kumar
Hi there,
That's strange.
Does the logo the home in a new window without that snippet?
Let me know :)
yes, it does.
It is a multisite.. so from sub-directory to primary domain. See sites details in the private box.
Can you disable that snippet for me to take a look?
The logo image should not open in a new window by default as it doesn't have the target="_blank" markup:
https://github.com/tomusborne/generatepress/blob/7fdcddf18209a84aaa75304ab23f768241e08ed4/inc/structure/header.php#L137
Have you modified the template in any way?
See image in the private box below.
I have now disabled it. Please check
Regards
Kumar
So it's still opening a new tab without the code?
In that case can you disable all plugins to first?
Hi Leo,
When the code is disabled, the shop home opens in the same window but as soon as I enable the code to the primary domain (probably considers it as an external domain) so opens in a new window/tab.
is there a way in the filter (generate_logo_href’, function())we could say it to open in the same tab for this url?
Regards
Kumar
The code is disabled currently correct?
The logo is still opening in a new tab to me:
https://www.screencast.com/t/21OWeUb9TXA
Is that not what you are seeing?
my apologies, I had enabled the code..
No disabled, pls check now.
I would like it to open in the same tab when code disabled.
So the code is disabled now?
This is what I'm still seeing with my browser cache cleared - still opening in a new window which is not the default behaviour:
https://www.screencast.com/t/21OWeUb9TXA
In that case, can you disable all plugins including GP Premium and any custom functions you are using?
Hi Leo,
Thanks a lot for all your help.
I had a plugin - WP External links which were forcing all external links to open in a new window.
Thanks
Kumar
No problem :)