Activity Stream
48,167 MEMBERS
6942 ONLINE
besthostingforums On YouTube Subscribe to our Newsletter besthostingforums On Twitter besthostingforums On Facebook besthostingforums On facebook groups

Results 1 to 9 of 9
  1.     
    #1
    Member

    Default Wordpress BlockQuote

    To make links clickable i use BlockQuote and make it clickable

    But it open in same page how do i add "_blank" so that it opens in a new page

    Can anyone help
    Perl Reviewed by Perl on . Wordpress BlockQuote To make links clickable i use BlockQuote and make it clickable But it open in same page how do i add "_blank" so that it opens in a new page Can anyone help Rating: 5

  2.   Sponsored Links

  3.     
    #2
    Member
    Website's:
    scrls.co.uk
    do you mean like this

    <blockquote><a href=”link_here” target=”_blank” rel=”nofollow”></blockquote>

    if not then post your code here so we can add it for you

  4.     
    #3
    Member
    Yes exactly i want this

    I get now when i post

    <blockquote><a href=" "></a></blockquote>

    How do i add this target=?_blank? automatically when i click " link " in wordpress

    Can anyone please help

  5.     
    #4
    Member
    Can someone please help

  6.     
    #5
    Member
    Use Jquery:

    <script type="text/javacript">
    jQuery(function() {
    jQuery(“a:not([@href*=http://YOURSITE.com/])”).not(“[href^=#]“)
    .addClass(“external”)
    .click(function(){
    window.open(this.href); // pop a new window
    return false; // return false to keep the actual link click from actuating
    })
    });
    </script>
    Note: This will open not only the links in block quotes but also any external links .

  7.     
    #6
    Member
    @Hillsid3

    Not working i have added this in header

    It opens in the same window

  8.     
    #7
    Member
    LoL i guess it doesn't really work

  9.     
    #8
    Member
    Damnit! of course it wont work.
    Visit http://jquery.com to learn more.

  10.     
    #9
    Member
    @Hillsid3 : Thx for the try

    Got the prefect solution Enjoy using it

    Hey finally i have something that works ... All links inside quote opens in a new window ( _blank )

    Edit your themes functions.php and add the following inside <?php ..... ?>

    add_action('init','buffer_output_for_links');
    function buffer_output_for_links() {
    if (!is_admin()) // No need to do in the admin
    ob_start('decorate_links');
    }
    function decorate_links($content) {
    $wpurl = get_bloginfo('wpurl');
    $parts = explode('<a',$content);
    for($index = 1; $index<count($parts); $index++) {
    // Break apart on '>' to isolate anchor attributes
    $part = explode('>',$parts[$index]);
    // Remove all target="_blank"
    $part[0] = preg_replace("#\\s*target\\s*=\\s*[\"'].*?['\"]\\s*#",' ',$part[0]);
    // Add target="_blank" to all
    $part[0] = preg_replace('#href\s*=\s*#','target="_blank" href=',$part[0]);
    // Remove target="_blank" from only this domain
    $part[0] = preg_replace("#target=\"_blank\" href=(['\"]){$wpurl}#","href=\\1{$wpurl}",$part[0]);
    // End this part by reassembling on the '>'
    $parts[$index] = implode('>',$part);
    }
    // Finally reassembling it all on the '<a' leaving a space for good measure
    $content = implode('<a ',$parts);
    return $content;
    }

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Wordpress Blockquote Style?
    By aKaK in forum Wordpress
    Replies: 6
    Last Post: 12th Jun 2012, 05:30 PM
  2. Wordpress Article Fetch [Aka Wordpress leecher!]
    By S?nic in forum Webmaster Resources
    Replies: 2
    Last Post: 11th Apr 2012, 06:48 PM
  3. Wordpress error when disable Wordpress Seo by Yoast
    By chipve in forum Webmaster Discussion
    Replies: 8
    Last Post: 8th Jul 2011, 07:11 PM
  4. [Hiring] Expert Wordpress Coder (Wordpress Guru)
    By MasterDKR in forum Completed Transactions
    Replies: 0
    Last Post: 2nd Aug 2010, 05:07 PM
  5. [Buying] Wordpress to Wordpress Post Leecher
    By gcs89 in forum Completed Transactions
    Replies: 1
    Last Post: 23rd Jul 2010, 11:45 PM

Tags for this Thread

BE SOCIAL