Skip to:
Content
Pages
Categories
Search
Top
Bottom

target=blank in Topic

  • @invtrdr

    Member

    Whenever I have a link in the topic and set it to open in a new window by using target=blank it does not work. It opens in same window. Even though I use target=blank, it disappears when I click on Edit to see if it is still there.

    Thanks.

Viewing 6 replies - 1 through 6 (of 6 total)
  • @kawauso

    Member

    It’s target="_blank", make sure you have the underscore. Otherwise, got an example? Are you using __ck__’s plugin to add _blank?

    @invtrdr

    Member

    I do the “_blank” thing. It disappears. Is there a plugin to make it work that way?

    Thanks.

    @invtrdr

    Member

    What plugin is required to make the “_blank” work?

    Thanks.

    @johnhiler

    Member

    @invtrdr

    Member

    It seems to open even internal links in a new tab. Just wanted external links opening in a new tab.

    Thanks.

    @invtrdr

    Member

    Got it working as I wanted. Used the code below for it. Thanks.

    <?php
    /*
    Plugin Name: Open Links in New Window
    */

    function bb_target_blank( $text ) {
    $text = preg_replace('|<a (.+?)>|i', '<a $1 target="_blank">', $text);
    return $text;
    }
    add_filter('post_text', 'bb_target_blank',255);

    ?>

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.
Skip to toolbar