Remove text “Category Archives / Lưu trữ danh” in theme Flatsome

calendar_today
schedule 9:16 Sáng
visibility 67 Lượt xem

Add to functions.php in main/child theme Flatsome:

function custom_flatsome_remove_archive_prefix($translated_text, $text, $domain) {
if ($domain !== ‘flatsome’) {
return $translated_text;
}
if (is_category() && strpos($text, ‘%s’) !== false) {
$pos = strpos($text, ‘%s’);
if ($pos !== false) {
$translated_text = substr($text, $pos);
}
}
return $translated_text;
}
add_filter(‘gettext’, ‘custom_flatsome_remove_archive_prefix’, 20, 3);
add_filter(‘gettext_with_context’, ‘custom_flatsome_remove_archive_prefix’, 20, 3);

Hữu ích?
Chia sẻ:

edit Viết bình luận

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *

Chào anh/chị, nếu cần hỗ trợ hãy liên hệ với chúng em tại đây nhé! 👋