This topic has 7 replies, 2 voices, and was last updated 7 years by Laura.

  • Author
  • #173440
     wilhalphoto
    Participant

    Hi,

    I would like the external link to open on a new tab? How do I do that?

    thank you!
    -will

    #173560
     Laura
    Moderator

    This may help 🙂 https://wordpress.org/plugins/wp-external-links/

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #173610
     wilhalphoto
    Participant

    oh no, another plugin 🙁 I have tons of them already.
    Is there another way?

    thanks!
    -wh

    #173727
     Laura
    Moderator

    Hello, try by adding this to the header.php ( at child theme ) just below <head>

    COPY CODE
    
    <script>
    /** 
     * Open all external links in a new window
     */
    jQuery(document).ready(function($) {
        $('a').not('[href*="mailto:"]').each(function () {
    		var isInternalLink = new RegExp('/' + window.location.host + '/');
    		if ( ! isInternalLink.test(this.href) ) {
    			$(this).attr('target', '_blank');
    		}
    	});
    });
    </script>
    
    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #173794
     wilhalphoto
    Participant

    Hi Laura,

    I currently do not have a header.php in my child theme, should i just create a new blank one or should i copy the parents theme and add your code?

    thanks!
    -will

    #173877
     Laura
    Moderator

    Hello, please copy it from the parent 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

    #174819
     wilhalphoto
    Participant

    thanks!

    #174970
     Laura
    Moderator

    Always happy to help 🙂

    Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution

    Laura Solanes - Graphic Designer and Web Designer

    Please be patient as I try to answer each topic as fast as i can.

    If you like the theme or the support you've received please consider leaving us a review on Themeforest!

    Always happy to help you 🙂

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

The forum ‘General questions’ is closed to new topics and replies.

Log in with your credentials

Forgot your details?