A veces es posible que desee tener una categoría entera de su blog con enlaces «nofollow», por ejemplo, si está vinculando a una gran cantidad de links externos. Éste es un TIP rápido y fácil de hacerlo. Disfrutelo!
Para hacerlo, simplemente copie el siguientes código y pégalo en su archivo functions.php. No se olvides de configurarlo con el ID de la categoría deseada en la línea 3.
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');
Si le ha gustado este artículo, por favor considere compartirlo!
Agregar un Comentario