Home Forums Basel support forum Translate portfolio slug

Translate portfolio slug

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #16556

    nuovomedia
    Participant

    Hello,

    I bought the Basel-theme and I am very enthouiast about it! Great theme!

    For a cliënt of mine I am creating a website with Basel theme. The website is multi lingual, with four languages. I use the portfolio for displaying there products. But when I visit a product, the URL will display /portfolio/product-name. I want to change /portfolio/ into /varieties/. This slug have to be translatable in the four languages.

    Is this possible? What is the best way to get this result?

    Thanks in forward!

    Marco

    #16562

    Artem Temos
    Keymaster

    Hello,

    Thank you so much purchasing our theme and contacting our support center.

    What plugin do you use to translate your website to four languages? In case you are using WPML, here is an article from their documentation that may help you https://wpml.org/documentation/getting-started-guide/translating-page-slugs/

    Kind Regards
    XTemos Studio

    #16683

    nuovomedia
    Participant

    Thanks for your quick reply. I managed to translate this slug. Now I found another slug. I can’t find a way to translate this one.

    If I add an Project categorie to the main navigation, the link goes to: “www.sitename.url/project-cat/baguette”. I want to replace “/project-cat/” for “/product/”.

    I can translate the taxonomy with WPML, but the slug stays “/project-cat/”. Where can I translate this slug?

    Greets, Marco

    #16685

    Artem Temos
    Keymaster

    Hello,

    You can change rewrite base for the portfolio categories in the file wp-content/plugins/basel-post-types/basel-post-types.php. Find this code

    
    $labels = array(
    	'name'					=> _x( 'Project Categories', 'Taxonomy plural name', $this->domain ),
    	'singular_name'			=> _x( 'Project Category', 'Taxonomy singular name', $this->domain ),
    	'search_items'			=> __( 'Search Categories', $this->domain ),
    	'popular_items'			=> __( 'Popular Project Categories', $this->domain ),
    	'all_items'				=> __( 'All Project Categories', $this->domain ),
    	'parent_item'			=> __( 'Parent Category', $this->domain ),
    	'parent_item_colon'		=> __( 'Parent Category', $this->domain ),
    	'edit_item'				=> __( 'Edit Category', $this->domain ),
    	'update_item'			=> __( 'Update Category', $this->domain ),
    	'add_new_item'			=> __( 'Add New Category', $this->domain ),
    	'new_item_name'			=> __( 'New Category', $this->domain ),
    	'add_or_remove_items'	=> __( 'Add or remove Categories', $this->domain ),
    	'choose_from_most_used'	=> __( 'Choose from most used text-domain', $this->domain ),
    	'menu_name'				=> __( 'Category', $this->domain ),
    );
    
    $args = array(
    	'labels'            => $labels,
    	'public'            => true,
    	'show_in_nav_menus' => true,
    	'show_admin_column' => false,
    	'hierarchical'      => true,
    	'show_tagcloud'     => true,
    	'show_ui'           => true,
    	'query_var'         => true,
    	'rewrite'           => true,
    	'query_var'         => true,
    	'capabilities'      => array(),
    );
    

    and replace with this one

    $labels = array(
    	'name'					=> _x( 'Project Categories', 'Taxonomy plural name', $this->domain ),
    	'singular_name'			=> _x( 'Project Category', 'Taxonomy singular name', $this->domain ),
    	'search_items'			=> __( 'Search Categories', $this->domain ),
    	'popular_items'			=> __( 'Popular Project Categories', $this->domain ),
    	'all_items'				=> __( 'All Project Categories', $this->domain ),
    	'parent_item'			=> __( 'Parent Category', $this->domain ),
    	'parent_item_colon'		=> __( 'Parent Category', $this->domain ),
    	'edit_item'				=> __( 'Edit Category', $this->domain ),
    	'update_item'			=> __( 'Update Category', $this->domain ),
    	'add_new_item'			=> __( 'Add New Category', $this->domain ),
    	'new_item_name'			=> __( 'New Category', $this->domain ),
    	'add_or_remove_items'	=> __( 'Add or remove Categories', $this->domain ),
    	'choose_from_most_used'	=> __( 'Choose from most used text-domain', $this->domain ),
    	'menu_name'				=> __( 'Category', $this->domain ),
    );
    
    $args = array(
    	'labels'            => $labels,
    	'public'            => true,
    	'show_in_nav_menus' => true,
    	'show_admin_column' => false,
    	'hierarchical'      => true,
    	'show_tagcloud'     => true,
    	'show_ui'           => true,
    	'query_var'         => true,
    	'rewrite'           => true,
    	'query_var'         => true,
    	'capabilities'      => array(),
    	'rewrite'           => array( 'slug' => 'your-slug' ),
    );

    Kind Regards
    XTemos Studio

    #16833

    nuovomedia
    Participant

    Hello, thanks for the solution. I have tried this and it works. But now I have two questions:

    1. How can I translate this with WPML? In French or German, the slug needs to be the French/German word for product: Produkt / Produit.

    2. When you guys place an update for the theme/plug-in. It could overwrite this solution. There isn’t a way to accomplish this in the child-theme?

    Thanks in forward!

    Greets, Marco

    #16837

    Artem Temos
    Keymaster

    Hi,

    1. This question is more related to the plugin. You may need to contact plugin’s developers for help in this question.

    2. Sorry, but it is not possible to change this function in the child theme at the moment.

    Kind Regards

Viewing 6 posts - 1 through 6 (of 6 total)