Home Forums WoodMart support forum Change Portfolio SLUG / New Custom Post Type

Change Portfolio SLUG / New Custom Post Type

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #83703

    luciushudson
    Participant

    Hi,
    Is it possible to change the Portfolio SLUG to (for example): ‘Clients’?
    Or do I need to create a new Custom Post Type?

    If so, which plugin do you recommend concerning compatibility issues?
    Custom Post Type UI or Toolset Types ??

    NOTE: I’m using WPML for making my WordPress/Woocommerce multi-language.

    THANKS!

    #83738

    Hello,

    You can change the slug and title of the Portfolio page in the admin area: Dashboard -> Pages -> edit portfolio page

    Best Regards

    #85979

    luciushudson
    Participant

    What I mean, Elise, is:
    This is the URL where I want to use the Portfolio Items (archive view):
    http://ec2-34-217-106-21.us-west-2.compute.amazonaws.com/clients/

    This is a Single/Singular Portfolio Item (so far I’m using demo content):
    http://ec2-34-217-106-21.us-west-2.compute.amazonaws.com/portfolio/suspendisse-quam-at-vestibulum/

    On the LAST URL, where it says PORTFOLIO, I would like my URL to say CLIENTS

    So my question (again) is:
    Is it possible to change the Portfolio SLUG to (for example): ‘Clients’?
    Or do I need to create a new Custom Post Type?

    #85986

    Artem Temos
    Keymaster

    Hi,

    Try to edit the file wp-content/plugins/woodmart-core/post-types.php and change the line

    'rewrite' => array('slug' => 'portfolio'),

    to this

    'rewrite' => array('slug' => 'clients'),

    And then go to Settings -> Permalinks and resave them.

    Regards

    #86332

    luciushudson
    Participant

    It looks like a solution, though not much of a friendly one.
    Is wp-content/plugins/woodmart-core/post-types.php a file that can be overwriten in the woodmart-child Child Theme folder??
    TKS!

    #86358

    Artem Temos
    Keymaster

    Try to add the following PHP code snippet to the child theme functions.php file to do this

    add_filter('register_post_type_args', 'portfolio_to_my_slug', 10, 2);
    function portfolio_to_my_slug($args, $post_type){
     
        if ($post_type == 'portfolio'){
            $args['rewrite']['slug'] = 'my_slug';
        }
     
        return $args;
    }
    #86384

    luciushudson
    Participant

    Re-saved permalinks and worked as a charm!
    THANK YOU VERY MUCH

    #86388

    Artem Temos
    Keymaster

    Great, you are welcome.

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