
Как добавить тег nofollow к ссылкам размещаемым в категориях Вордпресс?
Вставка этого кода в functions.php добавит атрибут nofollow ко всем ссылкам в категории в the_content.
1 2 3 4 5 6 7 8 |
function nofollow_cat_posts($text) { global $post; if( in_category(1) ) { // SET CATEGORY ID HERE $text = stripslashes(wp_rel_nofollow($text)); } return $text; } add_filter('the_content', 'nofollow_cat_posts'); |