Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #232334

    Hello, There is an option “Overwrite Portfolio Link setting” in editing portfolio item, how to set this link to be open in a new window? Thanks.

    #232588

    including the portfolio grid on hoempage, I also need to open the custom link in a new window, thanks.

    #232595

    Hi honesty1993!

    Thank you for using the theme. I hope you’re doing well today.

    Please edit config-templatebuilder > avia_shortcodes > portfolio.php, finds this code on line 623:

    $output .= "<h2 class='portfolio-preview-title entry-title' $markup><a href='{$link}'>".$entry->post_title."</a></h2>";
    

    Replace it with:

    $output .= "<h2 class='portfolio-preview-title entry-title' $markup><a target='_blank 'href='{$link}'>".$entry->post_title."</a></h2>";
    

    Regards,
    Ismael

    #232631

    Thanks for reply, Ismael. But it doesn’t work, basically I will put portfolio on two page and I hope both of them will open link in new window.
    Please check http://hkweb.chaogo.com/ and http://hkweb.chaogo.com/portfolio/
    Thanks.

    #233029

    Hello, I’m still waiting for response, thanks.

    #233156

    Hello, anyone can help?

    #233311

    Hi!

    Sorry for that. I thought you’re using the portfolio grid element. Please edit config-templatebuilder > avia_shortcodes > masonry_entries.php, find this code on line 782:

    if(!empty($this->atts['container_links']) || !empty($custom_url))
    				{
    					$this->loop[$key]['html_tags'] = array('a href="'.$this->loop[$key]['url'].'"','a'); //opening and closing tag for the masonry container
    				}

    Replace it with:

    if(!empty($this->atts['container_links']) || !empty($custom_url))
    				{
    					$this->loop[$key]['html_tags'] = array('a target="_blank" href="'.$this->loop[$key]['url'].'"','a'); //opening and closing tag for the masonry container
    				}

    Best regards,
    Ismael

    #233345

    Brilliant! That’s work for portfolio page, but it seems this change doesn’t affect the portfolio grid on homepage, please kindly advice again, thanks. http://hkweb.chaogo.com/

    #233581

    Hi!

    Edit portfolio.php on the same folder, find this code on line 411:

    $output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.$image."</".$link_markup[1].">";
    

    Replace it with:

    $output .= "<".$link_markup[0]." target='_blank' data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.$image."</".$link_markup[1].">";
    

    And this code on line 425:

    $output .= "<".$link_markup[0]." data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size )."</".$link_markup[1].">";
    

    Replace it with:

    $output .= "<".$link_markup[0]." target='_blank' data-rel='grid-".avia_post_grid::$grid."' class='grid-image avia-hover-fx'>".$custom_overlay.get_the_post_thumbnail( $the_id, $image_size )."</".$link_markup[1].">";
    

    Another line of code that you have to change is on line 432:

     $output .= "<h3 class='grid-entry-title entry-title' $markup><a href='{$title_link}' title='".esc_attr(strip_tags($title))."'>".$title."</a></h3>";
    

    Replace it with:

     $output .= "<h3 class='grid-entry-title entry-title' $markup><a target='_blank' href='{$title_link}' title='".esc_attr(strip_tags($title))."'>".$title."</a></h3>";
    

    Cheers!
    Ismael

    #233766

    fantastic!!! Thanks! that’s what I called great support!

Viewing 10 posts - 1 through 10 (of 10 total)
  • The topic ‘how to open portfolio custom link in a new window?’ is closed to new replies.