Ver Mensaje Individual
  #10 (permalink)  
Antiguo 24/05/2011, 08:31
chamampi
 
Fecha de Ingreso: mayo-2011
Ubicación: Bolivia
Mensajes: 5
Antigüedad: 13 años
Puntos: 1
Respuesta: eliminar category de la url

Para eso puedes utilizar un filtro:

Código PHP:
Ver original
  1. function remove_cat_base( $string, $type )
  2. {
  3.     global $wp_rewrite;
  4.     if ( $wp_rewrite->use_trailing_slashes == false )
  5.     {
  6.         if ( $type != 'single' && $type != 'category' )
  7.             return trailingslashit( $string );
  8.  
  9.         if ( $type == 'single' && ( strpos( $string, '.html/' ) !== false ) )
  10.             return trailingslashit( $string );
  11.  
  12.         if ( $type == 'category' && ( strpos( $string, 'category' ) !== false ) )
  13.         {
  14.             $aa_g = str_replace( "/category/", "/", $string );
  15.             return trailingslashit( $aa_g );
  16.         }
  17.         if ( $type == 'category' )
  18.             return trailingslashit( $string );
  19.     }
  20.     return $string;
  21. }
  22.  
  23. add_filter( 'user_trailingslashit', 'remove_cat_base', 55, 2 );

ver [URL="http://www.wpmayor.com/posts/wordpress-hacks/remove-category-base-in-wordpress/"]Remove Category Base in WordPress - WP Mayor[/URL]