0

Hi we have the custom post type:

$labels = array(
    'name' => __( 'Recipes' ),
    'singular_name' => __( 'Recetas' ),
    'add_new' => __( 'New Receta' ),
    'add_new_item' => __( 'Add Receta' ),
    'edit_item' => __( 'Edit  Receta' ),
    'new_item' => __( 'New Receta' ),
    'view_item' => __( 'View Receta' ),
    'search_items' => __( 'Find Receta' ),
    'not_found' =>  __( 'Nothing found' ),
    'not_found_in_trash' => __( 'No items found in trash.' ),
    
);

$args = array(
    'labels' => $labels,
    'has_archive' => false,
    'public' => true,
    'hierarchical' => false,
    'show_in_rest' => true,
    'supports' => array(
        'title',
        'editor',
        'custom-fields',
        'thumbnail'
    ),
    'menu_icon' => 'dashicons-list-view'
);
register_post_type( 'recetas', $args );

But we don't need an archive page for this post type. We have created a page for this porpose. The problem is that we can't have this page have a slug: /recetas/ despite the fact that in the arguments of the custom post noted: 'has_archive' => false I know that the archive page has higher priority. But is there a way around this?

1 Answer 1

0

Just go to Settings -> Permalinks and that should flush permalinks. WordPress needs to regenerate permastructs each time you made a modification, one way to do that is by that menu page, another - programmatically, via function flush_rewrite_rules() (just remember to remove it afterwards, cause it's a time-consuming process).

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.