ResolvedHow to change portfolio permalink?

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #9850
    roist
    Participant

    Hi,
    I have entered some portfolio items, and they all have this permalink: http://www.danga.rs/portfolios/portfolio-item

    Since I have created a portfolio page that is http://www.danga.rs/proizvodi I would like for all my portfolio items to have this permalink: http://www.danga.rs/proizvodi/portfolio-item

    How can I do this?

    Thanks

    #9852
    Althemist
    Keymaster

    Hi roist,

    it can be done, but not an “easy fix”. You’d need to change the slug for the portfolio post type in the theme functions. I’d suggest using a child theme and make the required changes there.

    I’ll ask our lead developer Alex to give you detailed instructions.

    Regards,
    Dimitar

    #9853
    roist
    Participant

    Yes thank you, please do.

    Best regards,

    #9880
    Alex
    Keymaster

    Hello Roist,

    We are sorry for the late response.

    You need to redefine the function that registers the zass-portfolio post type.
    Please use the following code in your child’s theme functions.php and replace < your custom portfolio slug > with the slug that you want. You can adapt any of the parameters, just leave the name of the post type: ‘zass-portfolio’.

    
    remove_action('init', 'zass_register_cpt_zass_portfolio', 5);
    add_action('init', 'zass_child_register_cpt_zass_portfolio', 5);
    function zass_child_register_cpt_zass_portfolio() {
    	$labels = array(
    			'name' => esc_html__('Portfolios', 'zass-plugin'),
    			'singular_name' => esc_html__('Portfolio', 'zass-plugin'),
    			'add_new' => esc_html__('Add New', 'zass-plugin'),
    			'add_new_item' => esc_html__('Add New Portfolio', 'zass-plugin'),
    			'edit_item' => esc_html__('Edit Portfolio', 'zass-plugin'),
    			'new_item' => esc_html__('New Portfolio', 'zass-plugin'),
    			'view_item' => esc_html__('View Portfolio', 'zass-plugin'),
    			'search_items' => esc_html__('Search Portfolios', 'zass-plugin'),
    			'not_found' => esc_html__('No portfolios found', 'zass-plugin'),
    			'not_found_in_trash' => esc_html__('No portfolios found in Trash', 'zass-plugin'),
    			'parent_item_colon' => esc_html__('Parent Portfolio:', 'zass-plugin'),
    			'menu_name' => esc_html__('Portfolios', 'zass-plugin'),
    	);
    	$args = array(
    			'labels' => $labels,
    			'hierarchical' => false,
    			'description' => 'Zass portfolio post type',
    			'supports' => array('title', 'editor', 'excerpt', 'author', 'thumbnail', 'trackbacks', 'revisions', 'page-attributes'),
    			'taxonomies' => array('zass_portfolio_category'),
    			'public' => true,
    			'show_ui' => true,
    			'show_in_menu' => true,
    			'show_in_nav_menus' => true,
    			'publicly_queryable' => true,
    			'exclude_from_search' => false,
    			'has_archive' => true,
    			'query_var' => true,
    			'can_export' => true,
    			'rewrite' => true,
    			'capability_type' => 'page',
    			'menu_icon' => 'dashicons-portfolio',
    			'rewrite' => array(
    					'slug' => esc_html__('< your custom portfolio slug >', 'zass-plugin')
    			)
    	);
    	register_post_type('zass-portfolio', $args);
    }
    

    Regards,
    Alex

    #27272
    Floppy78
    Participant

    Hi everyone! I have the same issue but when I modify my child theme functions.php with your code it simply duplicates (in WP menù) Porfolio, and does not changes the slug into my desired one. Could you help me with this problem?

    #27280
    Althemist
    Keymaster

    Hello Flora,

    you’re using a totally different theme, so you can’t use the code given above. Please open a new topic in the Grosso theme forum and our lead developer Alex would give you instructions.

    #27283
    Floppy78
    Participant

    I was serching in the forum for a similar issue with Grosso theme, I’ll post in the right section. Yhanks.

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

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register