Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/09/2010, 09:28
bengiss
 
Fecha de Ingreso: junio-2009
Mensajes: 79
Antigüedad: 14 años, 10 meses
Puntos: 0
Problema con custom post type

Hola a todos,

Tengo creado un Custom Post Type en mi tema y todo funciona correctamente a excepcion de un pequeño detalle, el url no me redirecciona correctamente, les coloco el codigo para explicarme mejor:

Código PHP:
Ver original
  1. /**
  2.  * Custom post type "Testimonials"
  3.  */
  4. add_action( 'init', 'create_post_type' );
  5. function create_post_type() {
  6.   register_post_type( 'testimonial',
  7.     array(
  8.       'labels' => array(
  9.         'name' => __( 'Testimonials' ),
  10.         'singular_name' => __( 'Testimonial' ),
  11.         'add_new_item' => __('Add New Testimonial')
  12.       ),
  13.       'public' => true,
  14.       'description' => __('Custom post type to add testimonials information'),
  15.       'menu_icon' => get_bloginfo('template_url') . '/images/testimonials.png',
  16.       'supports' => array('title', 'editor', 'thumbnail', 'custom-fields'),
  17.       'rewrite' => false
  18.     )
  19.   );
  20. }

La opcion rewrite la tengo en false y de esa manera me funciona perfectamente todo, pero si la coloco true o especifico el slug (array("slug" => "testimonial")), me cambia el permalink correctamente pero cuando abro el post me muestra la pagina de 404, si lo dejo en false si abre correctamente pero con el url "feo".

Alguien sabe cual puede ser el error?

Gracias de antemano.