• Hi,
    im getting crazy, and cant find a solution!

    This is my code:

    /*Register Alloggio Content Type*/
    add_action( 'init', 'maremoto_easy_room_content_type' );
    
    function maremoto_easy_room_content_type() {
    	$labels = array(
    		'name'               => _x( 'Alloggio', 'post type general name' ),
    		'singular_name'      => _x( 'Alloggio', 'post type singular name' ),
    		'add_new'            => _x( 'Aggiungi Nuovo', 'Alloggio' ),
    		'add_new_item'       => __( 'Aggiungi Nuovo Alloggio' ),
    		'edit_item'          => __( 'Edit Alloggio' ),
    		'new_item'           => __( 'Nuovo Alloggio' ),
    		'all_items'          => __( 'Tutti gli Alloggi' ),
    		'view_item'          => __( 'Guarda Alloggio' ),
    		'search_items'       => __( 'Cerca Alloggi' ),
    		'not_found'          => __( 'Nessun appartamento trovato' ),
    		'not_found_in_trash' => __( 'Nessun appartamento trovato nel Cestino' ),
    		'parent_item_colon'  => '',
    		'menu_name'          => 'Alloggio'
    	);
    	$args = array(
    		'labels'        => $labels,
    		'description'   => 'Holds our products and product specific data',
    		'public'        => true,
    		'menu_position' => 5,
    		'supports'      => array( 'title', 'editor', 'thumbnail', 'excerpt'),
    		'has_archive'   => true,
    
    	);
    	register_post_type( 'easy-room', $args );
    }
    //////////////////////////////////////
    
    add_action( 'init', 'maremoto_taxonomie_category_easy_room', 0 );
    function maremoto_taxonomie_category_easy_room() {
    	$labels = array(
    		'name'              => _x( 'Categorie Alloggio', 'taxonomy general name' ),
    		'singular_name'     => _x( 'Categoria Alloggio', 'taxonomy singular name' ),
    		'search_items'      => __( 'Cerca Categoria Alloggio' ),
    		'all_items'         => __( 'Tutte le Categorie' ),
    		'parent_item'       => __( 'Parent Categoria Alloggio' ),
    		'parent_item_colon' => __( 'Parent Categoria Alloggio:' ),
    		'edit_item'         => __( 'Edit Categoria Alloggio' ),
    		'update_item'       => __( 'Update Categoria Alloggio' ),
    		'add_new_item'      => __( 'Aggiungi Nuova Categoria' ),
    		'new_item_name'     => __( 'Nuova Categoria Alloggio' ),
    		'menu_name'         => __( 'Categorie Alloggio' ),
    	);
    	$args = array(
    		'labels' => $labels,
    		'hierarchical' => true,
    		'show_admin_column' => true,
    	);
    	register_taxonomy( 'easy-room_category', 'easy-room', $args );
    }
    //////////////////////////////////////

    hou can i remove base url from my Custom post type and My taxonomy?

    From:
    https://www.domain.com/easy-room_category/asia/
    https://www.domain.com/easy-room/kuta-villa-roma/

    to:
    https://www.domain.com/asia/
    https://www.domain.com/kuta-villa-roma/

    thanks a lot!
    Matteo

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    Generally speaking, you use the Rewrite API. The real issue is how will the request parser know the URL is for a category, taxonomy, post slug, or something else? The rewrite rules you define need to be able to know which query var to assign the URL fragment to. I’m not sure there is an answer for the way you want your URLs setup.

Viewing 1 replies (of 1 total)
  • The topic ‘Please Help! Remove base URL from Taxonomy and Post Type’ is closed to new replies.