Support » Plugins and Hacks » [Resolved] Open redirection to new tab? taget _blank?

[Resolved] Open redirection to new tab? taget _blank?

Viewing 8 replies - 1 through 8 (of 8 total)
  • How did you fix it? My redirections are not opening on new window.

    Edit your theme file and where permalink is put this in:

    <a href="<?php echo($permalink); ?>" title="<?php the_title_attribute(); ?>" rel="nofollow" target="_blank">SOME TEXT</a>

    Is there a way to make “target=’_blank'” only for the redirected links?

    put it in
    “if the custom field $redirect” is not empty then open in new tab,
    else just open “permalink”

    did you get this to work? and how?

    No. I’d like that only the redirected links to open in a new tab.

    Did you try with plugins for opening external link in a new window/tab?


    If this don’t work for you, here is the code that will replace the “redirect by custom field” (u should disable it if u use this).

    It will check if there is a redirect custom field and if there is, it will change normal permalink to the link in the redirect meta.

    $meta = get_post_custom();
    if($meta['redirect'][0]) {
     $permalink = $meta['redirect'][0];
    } else {
     $permalink = get_permalink();

    This way I think the plugin for external links should recognize it is external.


    Thiago Miro


    Finally I found a way:

    <?php if ( function_exists(‘redirect’) ){echo’target=”_blank”‘;} ?>

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘[Resolved] Open redirection to new tab? taget _blank?’ is closed to new replies.