Skip to:
Content
Pages
Categories
Search
Top
Bottom

target=blank in Topic


  • InvTrdr
    Member

    @invtrdr

    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)
  • 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

    @invtrdr

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

    Thanks.


    InvTrdr
    Member

    @invtrdr

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

    Thanks.


    johnhiler
    Member

    @johnhiler


    InvTrdr
    Member

    @invtrdr

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

    Thanks.


    InvTrdr
    Member

    @invtrdr

    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