Ask pro wordpress giúp với nào

Ryang

Newbie
Joined
Aug 10, 2013
Messages
27
Reactions
21
MR
0.000
Hi cậu,

Chắc cậu có cài plugin BBCode cho site. Bạn chỉ cần thêm đoạn code này khi edit function shortcode_url() của plugin :

Code:
function shortcode_url( $atts = array(), $content = NULL ) {
$atts = $this->attributefix( $atts );
// [url="http://www.google.com/"]Google[/url]
if ( isset($atts[0]) ) {
$url = $atts[0];
$text = $content;
}
// [url]http://www.google.com/[/url]
else {
$url = $text = $content;
}
if ( empty($url) ) return '';
if ( empty($text) ) $text = $url;
 
//Thêm code ở đây ;D
 
$length = strlen($url)/3;
$text = substr($url, 0, $length)."...".substr($url,-$length);
 
return '<a href="' . $url . '">' . do_shortcode( $text ) . '</a>';
}

Site bạn là gì? Mình có thể trao đổi exchange link ko? :)
 
Ấy, cái đó là khi cậu post thì có thể copy và set được. Còn những bài posts của authors khác thì cái này nó làm cho mình.

Nhưng đó là khi link nằm giữa tag
 

Announcements

Today's birthdays

Forum statistics

Threads
423,967
Messages
7,135,622
Members
176,443
Latest member
ww88sevents

Most viewed of week

Most discussed of week

Most viewed of week

Most discussed of week

Back
Top Bottom