Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Jeffrey Abuan
    Participant

    I’m experiencing an issue with the Announcer plugin on my WordPress site. The plugin has an option for links to ‘Open in the same window,’ but despite selecting this option, all links are still opening in a new tab.

    Here’s a bit more detail:
    WordPress version: 6.4
    Announcer plugin version: 6

    Steps I’ve already taken:

    1. Double-checked the plugin settings to ensure ‘Open in the same window’ is selected.
    2. Cleared my browser cache and tried multiple browsers.
    3. Deactivated other plugins to rule out any conflicts.

    Despite these efforts, the problem continues. Has anyone else encountered this issue or have any suggestions on how to resolve it? Your help would be greatly appreciated!

    Thanks in advance!

    Hi Jeffrey,

    Just saw your website. There is some javascript on your site which is opening all links in new tab.

    Please find that code and make changes as required.

    //<![CDATA[
    jQuery(document).ready(function($) {
        $('a').each(function() {
            var a = new RegExp('/' + window.location.host + '/');
            if (!a.test(this.href)) {
                $(this).click(function(event) {
                    var f_class = $(this).attr('class');
                    if (f_class == 'xoo-el-lostpw-tgr' || f_class == 'xoo-el-login-tgr') {
                        return true;
                    } else {
                        event.preventDefault();
                        event.stopPropagation();
                        window.open(this.href, '_blank'); <--- this line is opening in new tab
                    }
                });
            }
        });

    Thanks,
    Aakash

    Jeffrey Abuan
    Participant

    Thanks, super helpful. Appreciate your feedback.

    Glad this helped! I’m marking this topic as resolved.

Viewing 4 posts - 1 through 4 (of 4 total)
  • The topic ‘Open in the same window – not working’ is closed to new replies.

Subscribe to our Newsletter

Get updates on the WordPress plugins, tips and tricks to enhance your WordPress experience. No spam. View newsletter

By using this website, you agree to our Terms