Rename PROJECT custom post type and SLUG when using the DIVI Theme

Home Forums Themes Divi Rename PROJECT custom post type and SLUG when using the DIVI Theme

This topic contains 0 replies, has 1 voice, and was last updated by  Michael Love 1 week, 6 days ago.

Viewing 1 post (of 1 total)
  • Author
    Posts
  • #805

    Michael Love
    Keymaster

    Changing the custom post type “Projects” name and slug (URL) is easiest when your site is created on OPTe Network:

    Steps: (OPTe Network)
    Activate plugin “My Custom Functions”
    Insert code below and change “Artist(s)” to whatever you like.
    Goto Settings>Permalinks and hit the save button.

    
    // RENAME PROJECT CUSTOM POST TYPE DIVI THEME
    function rename_project_cpt() {
    
    register_post_type( 'project',
    	array(
    	'labels' => array(
    	'name'          => __( 'Artists', 'divi' ), // change the text Projects to anything you like
    	'singular_name' => __( 'Artist', 'divi' ), // change the text Project to anything you like
    	),
    	'has_archive'  => true,
    	'hierarchical' => true,
        'menu_icon'    => 'dashicons-images-alt2',  // you choose your own dashicon
    	'public'       => true,
    	
    	'rewrite'      => array( 'slug' => 'artist', 'with_front' => false ), // change the text portfolio to anything you like
      'supports'     => array(),
             
    ));
        }
    
    add_action( 'init', 'rename_project_cpt' );
    

    Not on OPTe Network?
    Follow the above steps or setup a child theme and insert the code into the functions.php file.

    • This topic was modified 8 months, 1 week ago by  Michael Love.
    • This topic was modified 1 week, 6 days ago by  Michael Love.
    • This topic was modified 1 week, 6 days ago by  Michael Love.
    • This topic was modified 1 week, 6 days ago by  Michael Love.
Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.