I have this plugin called xTechnos Redirect, that basically changes my links for posts to external links. What I can’t figure out is how I get the external links to open in a new tab. I’m guessing it’s something about adding the target=”_blank” somewhere, but the function doesn’t have an .
Here’s the code
[CODE]require_once(ABSPATH . ‘/wp-config.php’);
add_action(‘get_header’, ‘redirect’);
function redirect () {
global $post;
if (is_page()) {
if (get_post_meta($post->ID, ‘redirect’, true)) {
header(‘Location: ‘ . get_post_meta($post->ID, ‘redirect’, true));
}
}elseif(is_object($post) && !is_front_page()){
if (get_post_meta($post->ID, ‘redirect’, true)) {
header(‘Location: ‘ . get_post_meta($post->ID, ‘redirect’, true));
}
}
}