Post Grid Opening In New Tap

Hello!

I’ve used a post grid to display two “team members”. On hover, I get a button to click to view their individual Guide page. These pages are opening in a new tab. I want them to open on the same tab. Below are screenshots with relevant info:

https://i.imgur.com/gFHOwgm.png - the section
https://i.imgur.com/W9YLs1j.png - backend section setup.

Once again, I need on click the page to open in the same tab.

Thank you!

Hello Daniel, the links in guides tabs are for social profiles or external bios like linkedIn, Facebook etc, hence these are made to open in blank/new tab. The theme has no built in support to open the external links or social profiles in the same tab.

I have found a solution, in case someone in the future needs this.

Go to theme files and edit the header.php file, adding this script before the closing /head tag:

<script language="javascript">
jQuery(document).ready(function() {
    jQuery(`a[target='_blank'][href^='${window.location.origin}']`).each(function() { jQuery(this).removeAttr('target'); });
});
</script>

What this script does is it’s stripping the ‘target=_blank’ attribute from all links that start and end on the same domain. This does not remove the ‘target=_blank’ attribute from social links, for example.