Select Page
Advertisements

Want to replace the term “Projects” in the project taxonomy. Here’s how!

  1.  Open functions.php in your Child Theme and add the following code. Please Note: In this example, “Projects” is replaced with “Videos”. Simply replace all references to “Videos” below with whatever term you like.
/*Change Project permalink to Video*/
/*function custom_post_name () {
return array(
'feeds' => true,
'slug' => 'video',
'with_front' => false,
);
}
add_filter( 'et_project_posttype_rewrite_args', 'custom_post_name' );*//*Change all references of Project permalink to Video*/function et_pb_register_posttypes() {
$labels = array(
'name' => esc_html__( 'Videos', 'et_builder' ),
'singular_name' => esc_html__( 'Video', 'et_builder' ),
'add_new' => esc_html__( 'Add New ', 'et_builder' ),
'add_new_item' => esc_html__( 'Add New Video', 'et_builder' ),
'edit_item' => esc_html__( 'Edit Video', 'et_builder' ),
'new_item' => esc_html__( 'New Video', 'et_builder' ),
'all_items' => esc_html__( 'All Videos', 'et_builder' ),
'view_item' => esc_html__( 'View Video', 'et_builder' ),
'search_items' => esc_html__( 'Search Videos', 'et_builder' ),
'not_found' => esc_html__( 'Nothing found', 'et_builder' ),
'not_found_in_trash' => esc_html__( 'Nothing found in Trash', 'et_builder' ),
'parent_item_colon' => '',
);
$args = array(
'labels' => $labels,
'public' => true,
'publicly_queryable' => true,
'show_ui' => true,
'can_export' => true,
'show_in_nav_menus' => true,
'query_var' => true,
'has_archive' => true,
'rewrite' => apply_filters( 'et_project_posttype_rewrite_args', array(
'feeds' => true,
'slug' => 'video',
'with_front' => false,
) ),
'capability_type' => 'post',
'hierarchical' => false,
'menu_position' => null,
'supports' => array( 'title', 'author', 'editor', 'thumbnail', 'excerpt', 'comments', 'revisions', 'custom-fields' ),
);
register_post_type( 'project', apply_filters( 'et_project_posttype_args', $args ) );
$labels = array(
'name' => esc_html__( 'Video Categories', 'et_builder' ),
'singular_name' => esc_html__( 'Video Category)', 'et_builder' ),
'search_items' => esc_html__( 'Search Categories', 'et_builder' ),
'all_items' => esc_html__( 'All Categories', 'et_builder' ),
'parent_item' => esc_html__( 'Parent Category', 'et_builder' ),
'parent_item_colon' => esc_html__( 'Parent Category:', 'et_builder' ),
'edit_item' => esc_html__( 'Edit Category', 'et_builder' ),
'update_item' => esc_html__( 'Update Category', 'et_builder' ),
'add_new_item' => esc_html__( 'Add New Category', 'et_builder' ),
'new_item_name' => esc_html__( 'New Category Name', 'et_builder' ),
'menu_name' => esc_html__( 'Categories', 'et_builder' ),
);
register_taxonomy( 'project_category', array( 'project' ), array(
'hierarchical' => true,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array(
'feeds' => true,
'slug' => 'video_category',
'with_front' => false,
),
) );
$labels = array(
'name' => esc_html__( 'Video Tags', 'et_builder' ),
'singular_name' => esc_html__( 'Video Tags', 'et_builder' ),
'search_items' => esc_html__( 'Search Tags', 'et_builder' ),
'all_items' => esc_html__( 'All Tags', 'et_builder' ),
'parent_item' => esc_html__( 'Parent Tag', 'et_builder' ),
'parent_item_colon' => esc_html__( 'Parent Tag:', 'et_builder' ),
'edit_item' => esc_html__( 'Edit Tag', 'et_builder' ),
'update_item' => esc_html__( 'Update Tag', 'et_builder' ),
'add_new_item' => esc_html__( 'Add New Tag', 'et_builder' ),
'new_item_name' => esc_html__( 'New Tag Name', 'et_builder' ),
'menu_name' => esc_html__( 'Tags', 'et_builder' ),
);
register_taxonomy( 'project_tag', array( 'project' ), array(
'hierarchical' => false,
'labels' => $labels,
'show_ui' => true,
'show_admin_column' => true,
'query_var' => true,
'rewrite' => array(
'feeds' => true,
'slug' => 'video_tag',
'with_front' => false,
),
) );
}