Home Forums Theone WordPress Theme Disable Link and open new tab

This topic contains 3 replies, has 2 voices, and was last updated by  BWSM 6 months ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #14766

    MondayCreative
    Participant

    Hi there,

    How do I turn off a hyperlink when I’m choosing not to add one? At the moment, there are a number of points on my site that seem to be predetermined as something that should have a link, but because I have not entered one, when the link is clicked, the entire page reloads. For example, my client logo images have a link, but because I haven’t set one, it just reloads the page. I want to be able to turn the link option off where I’m choosing not to use it.

    The same applies for links within the website. I don’t want some links to work, but there doesn’t seem to be an option to turn them off. For example, in team members, when you hover over a team member’s photo and click their name, it takes you to the post about that team member. I do not want the site to do this. How do I turn this off?

    Also, how do I make links open in a new tab if I do want to use them. For example, my social media links will take my clients away from my website. I do not want this to happen. I would like all external links to open in a new tab.

    Thanks so much,
    Renae.

    #14769

    BWSM
    Keymaster

    Hi,

    There is not the theme option for disable or open new tab link.
    1. Use custom css to disable a link, by pointer-events: none. Find the className to set the css by develop tool of browser, like one menu item:
    menu

    .menu-item-2436 a {pointer-events: none;}

    the title of team:
    .team-item-title {pointer-events: none;}

    2. Use custom js to open new tab for a link, find a custom js plugin or use child theme to put the js code.
    Find the className for the element, like:

    jQuery('.social-icons-footer a').on('click', 'a', function(e){ 
        e.preventDefault(); 
        var url = jQuery.attr('href'); 
        window.open(url, '_blank');
    });

    If you want to add 2 or more link, use comma like:

    jQuery('.social-icons-footer a, .xxxx a').on('click', 'a', function(e){ 
        e.preventDefault(); 
        var url = jQuery.attr('href'); 
        window.open(url, '_blank');
    });

    Regards!
    Bwsm – uiueux.comTwitterFacebook

    #14801

    MondayCreative
    Participant

    You can’t save changes made in the developer tool of websites though. How do I disable a link permanently?

    #14802

    BWSM
    Keymaster

    You can not edit the code in develop tool , only can look for the className to set the css by develop tool, you need add the css into Theone / General Settings / Custom Css.

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.