Hello Summer Sale!
Exclusive season-opening discount on TheGem theme.
Limited time offer.

Okay
  Public Ticket #1170083
Change Portfolio name
Closed

Comments

  • dani_sanchez21 started the conversation

    Hello, I would like to change the permalink structure for portfolio items.

    As an example:

    This is how it is: domain/portfolios/portfolio-name

    I would like it to be like this: domain/custom-name/portfolio-name


    Thank you

  •  7,280
    Oliver replied

    HI!

    In the functions php of the child theme add next code:

    function thegem_portfolio_post_type_change() {
        $args = get_post_type_object("thegem_pf_item");
        $args->rewrite["slug"] = "NEW_SLUG";
        register_post_type($args->name, $args);
    }
    add_action('init', 'thegem_portfolio_post_type_change', 10); 

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • dani_sanchez21 replied

    Excellent,


    Thank you

  •  7,280
    Oliver replied

    You are welcome!

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver

  • BaptisteJesu replied

    Hi, I'm having the same question and your code works, only the new url /portfolio/my-portfolio gives me a 404 error (and the /portfolios/... urls are still working).

    I've also created a /portfolio single page so I can have :

    /portfolio - all my projects

    /portfolio/my-portfolio - Single project

    Any idea where it might come from ?

    Thanks !

  •  7,280
    Oliver replied

    HI!

    pls. provide the wp-admin access in the new private ticket. 

    Please note if you comment on your ticket before we reply, your ticket will be pushed down of the tickets list. 

    Regards, Oliver