0

Basically the single Permanent link are giving me 404 errors.

might be wrong?

Code is below:

function post_types(){
register_post_type('carta',array(
    'labels'            => array(
        'name'              => 'Cartas',
        'singular_name'     => 'Carta',
        'all_items'         => 'Todos la Carta',
        'add_new_item'      => 'Añadir nueva Item a la Carta',
        'edit_item'         => 'Editar Carta',
        'search_items'      => 'Buscar Carta',
        'not_found'         => 'No se encontro Ningún item de la Carta.',
        'not_found_in_trash'=> 'Ningún item de la carta encontrado en la papelera.',
         'rewrite' => array('slug' => 'carta', 'with_front' => false),
    ),

    'public'            => true,
    'show_ui'           => true,
    'publicly_queryable' => true,
    'hierarchical' => true,
    'menu_icon'         => 'dashicons-slides',
    'supports'          => array('title','editor','thumbnail','page-attributes','common'),
));
}
add_action('init','post_types');

Taxonomy

function create_taxonomies() {
register_taxonomy('category', array('carta'), array(
    'labels' => array(
     'name' => 'Categorias'
    ),
    'hierarchical' => TRUE,
    'show_ui' => true,
    'show_tagcloud' => false,
));

}
add_action('init', 'create_taxonomies');

1 Answer 1

0

Go to Settings/permalinks and click save.

To prevent this from being a problem with plugins, or themes that insatiate CPT's/ Taxonomies there is the function flush_rewrite_rules. here is the link from the codex.

3
  • If it hss been answered a million times, flag the question as duplicate to one of those million ;-) Commented Apr 19, 2016 at 5:32
  • Point taken. I guess you are after me!? Commented Apr 19, 2016 at 5:37
  • I can see how my original answer can be perceived as rude and elitist. I apologize. Commented Apr 19, 2016 at 6:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.