Okay
  Public Ticket #2255809
Change slug name for "Artist"
Closed

Comments

  • Francisco started the conversation

    I have reviewed the following ticket, but it does not solve what I need, I have already done the translation, but what I need now is to be able to modify the slug "artist" for another word.

    When I say the slug name, I mean the link on the website, for example: www.music.com/artist/singer

    I want to change the "artist" for another word

    Any help please.

  •  1,114
    Max replied

    Hi,

    Add this to your child theme's function.php:

    /*
    CHANGE SLUGS OF CUSTOM POST TYPES
    */
    function change_post_types_slug( $args, $post_type ) {
       /*item post type slug*/   
       if ( 'artist' === $post_type ) {
          $args['rewrite']['slug'] = 'another-word-here';
       }
       return $args;
    }
    add_filter( 'register_post_type_args', 'change_post_types_slug', 10, 2 );



    Thanks,


    Max from the Sonaar.io Crew

  • Francisco replied

    Hi Maxime! Thank you!
    There was one thing missing... Need to refresh all the permalinks for my changes to take place. Settings -> Permalink and simply save. Otherwise it doesn't work.


    Thank you again!