-
AuthorPosts
-
March 4, 2014 at 6:05 pm #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.
March 5, 2014 at 8:35 am #232588including the portfolio grid on hoempage, I also need to open the custom link in a new window, thanks.
March 5, 2014 at 8:48 am #232595Hi 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,
IsmaelMarch 5, 2014 at 10:10 am #232631Thanks 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.March 6, 2014 at 1:44 am #233029Hello, I’m still waiting for response, thanks.
March 6, 2014 at 11:50 am #233156Hello, anyone can help?
March 6, 2014 at 6:07 pm #233311Hi!
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,
IsmaelMarch 6, 2014 at 6:39 pm #233345Brilliant! 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/
March 7, 2014 at 5:21 am #233581Hi!
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!
IsmaelMarch 7, 2014 at 3:52 pm #233766fantastic!!! Thanks! that’s what I called great support!
-
AuthorPosts
- The topic ‘how to open portfolio custom link in a new window?’ is closed to new replies.