حسن غویشه
کاربر عضو
سلام
یک کد نوشتم و میخوام به کلماتی که مشخص کردم لینک مورد نظرم رو بده
ولی کار نمی کنه
function testLink($content) {
$words=array('example','example1');
foreach ($words as $word) {
$links= '<a href=""></a>';
$content = str_replace($word,$links,$content);
}
return $content;
}
add_filter('the_content','testLink');
add_filter('the_excerpt','testLink');
اطفا راهنمایی نمایید
:53:
یک کد نوشتم و میخوام به کلماتی که مشخص کردم لینک مورد نظرم رو بده
ولی کار نمی کنه
function testLink($content) {
$words=array('example','example1');
foreach ($words as $word) {
$links= '<a href=""></a>';
$content = str_replace($word,$links,$content);
}
return $content;
}
add_filter('the_content','testLink');
add_filter('the_excerpt','testLink');
اطفا راهنمایی نمایید
:53:
آخرین ویرایش توسط مدیر: