Okay
  Public Ticket #2736848
Changing Artist Permalink
Closed

Comments

  • Alyssa started the conversation

    Hey Folks,

    First, I want to say that your Podcastr theme is amazing! I love it.


    I am using the Podcastr theme for my website and I am using the Artists and Playlist functionality as a way to showcase the podcast host's guest appearances on other podcasts. So, I'm hoping to change the .com/artist slug to .com/guest. I'm seeing a way to change a variety of slugs, but not the artist slug. Looking through the previous tickets I see only one solution which would be a child theme to change the slug. Is there another way to change it without developing a child theme? My HTML is great, my CSS not so much.


    Any help you could provide is greatly appreciated. Thanks for all you do and have a good one!

  •  1,103
    Max replied

    Hello Alyssa,


    Thanks for your comment.

    If you want to rename the custom post type slug Artist to something else, you can do it by adding custom code in your function.php of your child theme.

    Add this to your function.php:

    function change_post_types_slug( $args, $post_type ) {
       
       if ( 'artist' === $post_type ) {
          $args['rewrite']['slug'] = 'guest';
       }
       return $args;
    }
    add_filter( 'register_post_type_args', 'change_post_types_slug', 10, 2 );

    This will rename our artist CPT slug to 'guest'.


     

    Thanks,


    Max from the Sonaar.io Crew

  • Alyssa replied

    Hi Max,

    Thank you for your quick reply! One more quick question:


    Am I putting the code below into the "Stylesheet" or the "Theme Functions" section of the Sonaar Child Theme files?



  •  1,103
    Max replied

    Theme function (function.php)

    Thanks,


    Max from the Sonaar.io Crew

  • Alyssa replied

    Hi Max,

    Works wonderfully! Thank you so much for your help. You can close this ticket.

    Alyssa