Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #21438

    Hi,

    Is it possible to use target=”_blank” within the image link field of the partner list?

    So some partners open up in a new tab/page.

    Thank you

    #111803

    It’s not possible to change the link target for each image/logo individually but you can replace following code in wp-contentthemeschoicesincludeshelper-template-dynamic.php:

    if(!empty($set['link']) && $set['link'] != "http://")
    {
    $img = "<a href='".$set['link']."' title=''>$img</a>";
    }

    with:

    if(!empty($set['link']) && $set['link'] != "http://")
    {
    $img = "<a href='".$set['link']."' target='_blank' title=''>$img</a>";
    }

    - afterwards all links will open in a new window/tab.

    #111804

    How can I do the same but for the portfolio links? E.g when user clicks on the image http://awesomescreenshot.com/04216pnx9f

    Thanks,

    Dave

    #111805

    I’d recommend to use a js script in this case – open up choices/js/avia.js and at the very top replace:

    jQuery(document).ready(function(){

    with

    jQuery(document).ready(function(){

    jQuery(".slideshow a").filter(function() {
    return this.hostname && this.hostname !== location.hostname;
    }).attr('target', '_blank');

    #111806

    I have done that but it still seems to open up the link in the same tab. I have added the code you said and used this setting for the link http://awesomescreenshot.com/09d16sjm28

    Is that correct or am I missing something?

    #111807

    The code should work – it compares the current url with the link url and if the link url points to an external website it will add target=”blank” to it. Can you post a link to your website please? I’ll check why this code doesn’t work atm.

    #111808

    The ‘Nice Image” should have the link. http://cheapfollowers.net/template-files/portfolio-4-columns/

    Maybe if I manually enter the current URL in the code?

    Thanks!

    #111809

    Ah, ok – I think I found the problem. The ajax content doesn’t exist on page load but you need to bind the filter function to the slideshow with the ajax call event.

    Revert the change s I posted above and replace:

    function avia_ajax_call(container)
    {
    if(typeof container == 'undefined'){ container = 'body';};

    with

    function avia_ajax_call(container)
    {
    if(typeof container == 'undefined'){ container = 'body';};

    jQuery(".slideshow a").filter(function() {
    return this.hostname && this.hostname !== location.hostname;
    }).attr('target', '_blank');

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

The topic ‘Partner image link target="_blank"’ is closed to new replies.