Results 1 to 9 of 9
-
28th Feb 2011, 08:32 PM #1OPMember
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 helpPerl 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
-
28th Feb 2011, 08:33 PM #2MemberWebsite's:
scrls.co.ukdo 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
-
28th Feb 2011, 08:40 PM #3OPMember
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
-
18th Mar 2011, 10:12 PM #4OPMember
Can someone please help
-
18th Mar 2011, 10:21 PM #5Member
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>
-
18th Mar 2011, 10:36 PM #6OPMember
@Hillsid3
Not working i have added this in header
It opens in the same window
-
18th Mar 2011, 10:58 PM #7Member
LoL i guess it doesn't really work
-
18th Mar 2011, 11:01 PM #8Member
Damnit! of course it wont work.
Visit http://jquery.com to learn more.
-
18th Mar 2011, 11:51 PM #9OPMember
@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;
}
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
Wordpress Blockquote Style?
By aKaK in forum WordpressReplies: 6Last Post: 12th Jun 2012, 05:30 PM -
Wordpress Article Fetch [Aka Wordpress leecher!]
By S?nic in forum Webmaster ResourcesReplies: 2Last Post: 11th Apr 2012, 06:48 PM -
Wordpress error when disable Wordpress Seo by Yoast
By chipve in forum Webmaster DiscussionReplies: 8Last Post: 8th Jul 2011, 07:11 PM -
[Hiring] Expert Wordpress Coder (Wordpress Guru)
By MasterDKR in forum Completed TransactionsReplies: 0Last Post: 2nd Aug 2010, 05:07 PM -
[Buying] Wordpress to Wordpress Post Leecher
By gcs89 in forum Completed TransactionsReplies: 1Last Post: 23rd Jul 2010, 11:45 PM
themaCreator - create posts from...
Version 3.17 released. Open older version (or...