Change Permalink
-
Hello again!
I finally managed to change the permalink from /properties/ to /directorio/ as I needed to, but the thing is, /directorio/ is showing me the 404 error page and /properties/ is still listing all the properties I’ve added.
All the links in the page have automatically changed thanks to the code in https://www.wprealia.com/documentation/general-topics/post-types.html#changing-the-permalink but when I click on them they don’t exist.
Am I doing something wrong? Here’s the code I’ve added:
remove_action( 'init', array( 'Realia_Post_Type_Property', 'definition' ) ); add_action( 'init', 'my_custom_function' ); function my_custom_function() { $labels = array( 'name' => __( 'Properties', 'realia' ), 'singular_name' => __( 'Property', 'realia' ), 'add_new' => __( 'Add New Property', 'realia' ), 'add_new_item' => __( 'Add New Property', 'realia' ), 'edit_item' => __( 'Edit Property', 'realia' ), 'new_item' => __( 'New Property', 'realia' ), 'all_items' => __( 'All Properties', 'realia' ), 'view_item' => __( 'View Property', 'realia' ), 'search_items' => __( 'Search Property', 'realia' ), 'not_found' => __( 'No Properties found', 'realia' ), 'not_found_in_trash' => __( 'No Properties found in Trash', 'realia' ), 'parent_item_colon' => '', 'menu_name' => __( 'Properties', 'realia' ), ); register_post_type( 'property', array( 'labels' => $labels, 'supports' => array( 'title', 'editor', 'thumbnail', 'comments', 'author' ), 'public' => true, 'has_archive' => true, 'rewrite' => array( 'slug' => 'directorio' ), 'menu_position' => 43, 'categories' => array(), 'menu_icon' => 'dashicons-admin-home', ) ); }
Thanks!
Viewing 5 replies - 1 through 5 (of 5 total)
Viewing 5 replies - 1 through 5 (of 5 total)
- The topic ‘Change Permalink’ is closed to new replies.