Search Divi Plus Documentation

Search for answers or browse our knowledge base.

All Topics
Print

How to change “dipl-team-member” slug from URL in DP team member

To change the slug for the DP Team Member Custom post type please add the following function in the function.php file of the child theme.

To do this follow the below steps:

Move to site Dashboard >> Appearance >> Theme File Editor >> Theme Files >> Theme Functions >> functions.php

function dipl_ct_change_post_type_slug($args, $post_type){
 
    if ( 'dipl-team-member' === $post_type ){
        $args['rewrite']['slug'] = 'team-member';
    }
 
    return $args;
}
add_filter('register_post_type_args', 'dipl_ct_change_post_type_slug', 10, 2);

Change the value ‘team-member’ as per your requirement.

After adding the code to the function.php file, it’s important to reset the permalinks. This can often resolve any unexpected issues with URLs or links on your website. Here’s how to do it:

  1. Log in to your WordPress dashboard.
  2. Go to Settings > Permalinks.
  3. Without making any changes, scroll down to the bottom of the page and click on the “Save Changes” button.
  4. WordPress will then flush and regenerate your site’s permalinks.

Once the permalinks are reset, check if the desired functionality is restored. If you continue to encounter any issues contact us via our support portal.

https://diviextended.atlassian.net/servicedesk/customer/portals

Table of Contents