Search code examples
wordpresshyperlinkpermalinks

All links don't work unless I open them in a new tab


I have a website built on Exploring WordPress theme on a subdirectory of my main website. The problem is all links don't redirect unless I right-click and open them in a new tab. I tried to deactivate all the plugins, but nothing.

The exact same theme is installed on another host and works properly, I'm attaching chrome console, BTW I tried Chrome on the desktop, IE on the desktop, then Chrome on my mobile, but the same problem.

IMAGE

UPDATE : jump to top button works, but links don't, <a> tag is defined properly, but doesn't work. I switched to Twenty Fifteen theme and the problem disappeared, but it work on the exact same theme installed on another host.


Solution

  • Simply add this JQuery code in your footer part and then check.

    <script>    
       $('a').click(function(){
        var link = $(this).attr('href');
        window.location.href = link;
       })
    </script>