Viewing 22 posts - 1 through 22 (of 22 total)
  • Author
    Posts
  • #664270

    See the page link below. Click the first portfolio item, PWM. The link actually goes to a different site, and I need for this to open in a new window/tab. In “Portfolio Items”, under the “Additional Portfolio Settings”, I have the “Overwrite Portfolio Link” setting set to “Define Custom Link”, and then I have the link pasted in to the “Link portfolio item to external URL” field. Though, there is no option in the interface to have this link open in a new window/tab. How can I accomplish this?

    http://66.147.242.174/~lsiairli/outdoor/

    Thanks for your help in advance

    #664295

    sorry – as a participant as you are i can not help you because i don’t see the site – “Password protected”
    i think there is a Password in the hidden part of the thread here so you have to wait on Mods.

    #664953

    Hi,

    Please enable the custom css class field: http://kriesi.at/documentation/enfold/turn-on-custom-css-field-for-all-alb-elements/ and then edit your portfolio grid element and give it a custom CSS class then add following code to Functions.php file of your child theme in Appearance > Editor

    function av_portfolio_new_tab(){
    ?>
     <script>
    jQuery(window).load(function(){
    jQuery('.your-custom-class a').attr('target','_blank');
    });
     </script>
    <?php
    }
    add_action('wp_footer', 'av_portfolio_new_tab');

    Best regards,
    Yigit

    #689275

    ^UPVOTE, finally found the right solution. Thanks!

    #689279

    Hi,

    Glad it worked for you! :)

    We will keep the thread open and will wait to hear from the creator of this thread. If you have any other questions or issues, please feel free to start a new thread.

    Best regards,
    Yigit

    #702304

    Hello
    please add this setting in next updates : select menu : target for same window or new window above field Link portfolio item to external URL
    it will be helpfull
    have a nice day

    #702451

    Hi,

    Please feel free to request – or vote if already requested – such feature on Enfold feature request form.

    Best regards,
    Yigit

    #840690

    Hi Yigit,
    I tried to follow your instructions but my portfolio links still open in the same window.

    Here’s what I have done:
    Via Filezilla I accessed the functions.php file (wp-content/themes/enfold) and have edited it in Dreamweaver: I have added the following underneath the code that was there:

    add_theme_support(‘avia_template_builder_custom_css’);

    and saved it to replace the functions.php file.

    I then opened my portfolio page and clicked on the Portfolio Grid.
    Under Custom Css Class I wrote in cr-portfolionewtab and clicked save.

    In Appearance > Editor I selected the functions.php file in the Enfold theme.

    Then copied the following code to the bottom of the code that was there:

    function av_portfolio_new_tab(){
    ?>
    <script>
    jQuery(window).load(function(){
    jQuery(‘.cr-portfolionewtab a’).attr(‘target’,’_blank’);
    });
    </script>
    <?php
    }
    add_action(‘wp_footer’, ‘av_portfolio_new_tab’);

    But all links are still opening in the same window.
    Thanks for your help!
    Carolin

    • This reply was modified 6 years, 7 months ago by messmeriza.
    #841394

    Hi Carolin,

    Here is the code you can put in your funtions.php

    
    function av_portfolio_new_tab() {
    ?>
    <script>
    	jQuery(window).load(function() {
    		jQuery('.grid-image').attr('target','_blank');
    	});
    </script>
    <?php
    }
    add_action('wp_footer', 'av_portfolio_new_tab');
    

    If you need further assistance please let us know.
    Best regards,
    Victoria

    #842266

    Thanks Victoria! It works :)

    #842481

    Hi messmeriza,

    Glad you we it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1057968

    Hi there,
    This works great for me – except it opens internal as well as external links in a new tab/window. I only want external links in my portfolio grid to open in a new tab/window – not links to other post/pages within the site.
    Is there any way the code can accommodate this?
    Thanks,
    Jason

    #1058247

    Hi Jason,

    Well, your class selector in the script has to be specific just for the portfolio pages. Do you need help with that?

    Best regards,
    Victoria

    #1295194

    Hi,
    I put this code in function.php of my chidtheme

    function av_portfolio_new_tab() {
    ?>
    <script>
    	jQuery(window).load(function() {
    		jQuery('.grid-image').attr('target','_blank');
    	});
    </script>
    <?php
    }
    add_action('wp_footer', 'av_portfolio_new_tab');

    and I give the av_portfolio_new_tab class to the portfolio grid, but don’t open a news window.

    What can i do?

    #1295670

    Hi sere,

    Can you give us the link for the page where this is supposed to work? so we can check if there are any js errors preventing it from working.

    Best regards,
    Nikko

    #1319394
    This reply has been marked as private.
    #1319537

    Never mind I figured it out. Thank you!

    #1319607

    Hi SandraSquires,

    Great, I’m glad that you figured it out, and thanks for the update :-)

    Best regards,
    Rikard

    #1323028

    I had this working but now it is not. Can you help with it?

    #1323034

    Hey,

    I edited your Porfolio Grid elements and gave them “blank-target” ID in Advanced > Developer Settings and then changed your code in functions.php file to following one

    function av_portfolio_new_tab() {
    ?>
    <script>
    	jQuery(window).load(function() {
    		jQuery('#blank-target .grid-image').attr('target','_blank');
    	});
    </script>
    <?php
    }
    add_action('wp_footer', 'av_portfolio_new_tab');

    Please review your website :)

    Regards,
    Yigit

    #1323042

    Thank you for your help!

    #1323044

    Hi,

    You are welcome!

    Let us know if you have any other questions and enjoy the rest of your day :)

    Best regards,
    Yigit

Viewing 22 posts - 1 through 22 (of 22 total)
  • The topic ‘Portfolio item links need to open in new browser window’ is closed to new replies.