Comments Kasper started the conversationNovember 20, 2014 at 12:33pmHi guysHow can I make the 'Team Memeber Link URL' open in a new window/tab?Thank you- Kasper 8,844Tahir repliedNovember 20, 2014 at 4:12pmHey Kasper!You will have to add a target="_blank" to the anchor tag in "Saleint/nectar/tinymce/shortcode-processing.php" . Simply search for "Team Member" .Thanks ThemeNectar Support Team Kasper repliedNovember 20, 2014 at 6:09pm Hey Tahir Something went wrong. It has no effect :( Here is my code: //Team Member function nectar_team_member($atts, $content = null) { extract(shortcode_atts(array("description" => '', 'team_memeber_style' => '', 'color' => 'Accent-Color', 'name' => 'Name', 'job_position' => 'Job Position', 'image_url' => '', 'social' => '', 'link_element' => 'none', 'link_url' => '', 'link_url_2' => ''), $atts)); $html = null; $html .= '<div data-style="'.$team_memeber_style.'">'; if($team_memeber_style == 'meta_overlaid'){ $html .= '<div></div>'; if(!empty($image_url)){ if(preg_match('/^\d+$/',$image_url)){ $image_src = wp_get_attachment_image_src($image_url, 'portfolio-thumb'); $image_url = $image_src[0]; } //image link if(!empty($link_url_2)){ $html .= '<a href="'.$link_url_2.'" target="_blank"></a> <div style="background-image: url('.$image_url.');"></div>'; } else { $html .= '<div style="background-image: url('.$image_url.');"></div>'; } } else { //image link if(!empty($link_url_2)){ $html .= '<a href="'.$link_url_2.'" target="_blank"></a><div style="background-image: url('. NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg);"></div>'; } else { $html .= '<div style="background-image: url('. NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg);"></div>'; } } //name link $html .= '<div>'; $html .= '<h3>' . $name . '</h3>'; $html .= '<p>' . $job_position . '<p>'; $html .= '</div>'; } else { if(!empty($image_url)){ if(preg_match('/^\d+$/',$image_url)){ $image_src = wp_get_attachment_image_src($image_url, 'full'); $image_url = $image_src[0]; } //image link if($link_element == 'image' || $link_element == 'both'){ $html .= '<a href="'.$link_url.'"><img alt="'.$name.'" src="' . $image_url .'" title="' . $name . '" /></a>'; } else { $html .= '<img alt="'.$name.'" src="' . $image_url .'" title="' . $name . '" />'; } } else { //image link if($link_element == 'image' || $link_element == 'both'){ $html .= '<a href="'.$link_url.'" target="_blank"><img alt="'.$name.'" src="' . NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg" title="' . $name . '" /></a>'; } else { $html .= '<img alt="'.$name.'" src="' . NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg" title="' . $name . '" />'; } } //name link if($link_element == 'name' || $link_element == 'both'){ $html .= '<h4><a href="'.$link_url.'">' . $name . '</a></h4>'; } else { $html .= '<h4>' . $name . '</h4>'; } $html .= '<div>' . $job_position . '</div>'; $html .= '<p>' . $description . '</p>'; if (!empty($social)) { $social_arr = explode(",", $social); $html .= '<ul>'; for ($i = 0 ; $i < count($social_arr) ; $i = $i + 2) { $target = null; $url_host = parse_url($social_arr[$i + 1], PHP_URL_HOST); $base_url_host = parse_url(get_template_directory_uri(), PHP_URL_HOST); if($url_host != $base_url_host || empty($url_host)) { $target = 'target="_blank"'; } $html .= "<li><a ".$target." href='" . $social_arr[$i + 1] . "'>" . $social_arr[$i] . "</a></li>"; } $html .= '</ul>'; } } $html .= '</div>'; return str_replace("\r\n", '', $html); } add_shortcode('team_member', 'nectar_team_member');Thank you- Kasper 8,844Tahir repliedNovember 21, 2014 at 4:38pmHey!could you allow us to log in so we can check on this for you more?Thanks ThemeNectar Support Team Kasper replied privately 8,844Tahir repliedNovember 28, 2014 at 5:01pmHey!Seems to be working now when i switched to Parent Theme. Please try doing a hard refresh on your browser if you arent seeing it. Thanks ThemeNectar Support Team Kasper repliedNovember 28, 2014 at 5:28pmYes it works when the parent theme is on, but not with the child themeI have tried to hard refresh and even another browser.. 8,844Tahir repliedNovember 28, 2014 at 6:11pmSee screenshot: http://prntscr.com/5b08h9 , you dont need this . Have commented it out and its working fine now in child theme also. Thanks ThemeNectar Support Team Kasper repliedDecember 1, 2014 at 11:20amThank you ;-) Sign in to reply ...
Hi guys
How can I make the 'Team Memeber Link URL' open in a new window/tab?
Thank you
- Kasper
Hey Kasper!
You will have to add a target="_blank" to the anchor tag in "Saleint/nectar/tinymce/shortcode-processing.php" . Simply search for "Team Member" .
Thanks
ThemeNectar Support Team
Hey Tahir
Something went wrong. It has no effect :(
Here is my code:
//Team Member
function nectar_team_member($atts, $content = null) {
extract(shortcode_atts(array("description" => '', 'team_memeber_style' => '', 'color' => 'Accent-Color', 'name' => 'Name', 'job_position' => 'Job Position', 'image_url' => '', 'social' => '', 'link_element' => 'none', 'link_url' => '', 'link_url_2' => ''), $atts));
$html = null;
$html .= '<div data-style="'.$team_memeber_style.'">';
if($team_memeber_style == 'meta_overlaid'){
$html .= '<div></div>';
if(!empty($image_url)){
if(preg_match('/^\d+$/',$image_url)){
$image_src = wp_get_attachment_image_src($image_url, 'portfolio-thumb');
$image_url = $image_src[0];
}
//image link
if(!empty($link_url_2)){
$html .= '<a href="'.$link_url_2.'" target="_blank"></a> <div style="background-image: url('.$image_url.');"></div>';
} else {
$html .= '<div style="background-image: url('.$image_url.');"></div>';
}
}
else {
//image link
if(!empty($link_url_2)){
$html .= '<a href="'.$link_url_2.'" target="_blank"></a><div style="background-image: url('. NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg);"></div>';
} else {
$html .= '<div style="background-image: url('. NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg);"></div>';
}
}
//name link
$html .= '<div>';
$html .= '<h3>' . $name . '</h3>';
$html .= '<p>' . $job_position . '<p>';
$html .= '</div>';
} else {
if(!empty($image_url)){
if(preg_match('/^\d+$/',$image_url)){
$image_src = wp_get_attachment_image_src($image_url, 'full');
$image_url = $image_src[0];
}
//image link
if($link_element == 'image' || $link_element == 'both'){
$html .= '<a href="'.$link_url.'"><img alt="'.$name.'" src="' . $image_url .'" title="' . $name . '" /></a>';
} else {
$html .= '<img alt="'.$name.'" src="' . $image_url .'" title="' . $name . '" />';
}
}
else {
//image link
if($link_element == 'image' || $link_element == 'both'){
$html .= '<a href="'.$link_url.'" target="_blank"><img alt="'.$name.'" src="' . NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg" title="' . $name . '" /></a>';
} else {
$html .= '<img alt="'.$name.'" src="' . NECTAR_FRAMEWORK_DIRECTORY . 'assets/img/team-member-default.jpg" title="' . $name . '" />';
}
}
//name link
if($link_element == 'name' || $link_element == 'both'){
$html .= '<h4><a href="'.$link_url.'">' . $name . '</a></h4>';
} else {
$html .= '<h4>' . $name . '</h4>';
}
$html .= '<div>' . $job_position . '</div>';
$html .= '<p>' . $description . '</p>';
if (!empty($social)) {
$social_arr = explode(",", $social);
$html .= '<ul>';
for ($i = 0 ; $i < count($social_arr) ; $i = $i + 2) {
$target = null;
$url_host = parse_url($social_arr[$i + 1], PHP_URL_HOST);
$base_url_host = parse_url(get_template_directory_uri(), PHP_URL_HOST);
if($url_host != $base_url_host || empty($url_host)) {
$target = 'target="_blank"';
}
$html .= "<li><a ".$target." href='" . $social_arr[$i + 1] . "'>" . $social_arr[$i] . "</a></li>";
}
$html .= '</ul>';
}
}
$html .= '</div>';
return str_replace("\r\n", '', $html);
}
add_shortcode('team_member', 'nectar_team_member');
Thank you
- Kasper
Hey!
ThemeNectar Support Team
Hey!
Seems to be working now when i switched to Parent Theme. Please try doing a hard refresh on your browser if you arent seeing it.
Thanks
ThemeNectar Support Team
Yes it works when the parent theme is on, but not with the child theme
I have tried to hard refresh and even another browser..
See screenshot: http://prntscr.com/5b08h9 , you dont need this . Have commented it out and its working fine now in child theme also.
Thanks
ThemeNectar Support Team
Thank you ;-)