With Divi, the custom post type “Projects” is automatically created. This section is intended to present your own references, projects or case studies. Using the Divi module “Filterable Portfolio” you can display the different projects on your website.

However, if you don’t have any projects, you can remove the tab from your backend.

Just add the following code to your functions.php in the child theme.

/* Removes the menu item "Projects" from the WordPress menu */
add_filter( 'et_project_posttype_args', 'mytheme_et_project_posttype_args', 10, 1 );
function mytheme_et_project_posttype_args( $args ) {
    return array_merge( $args, array(
        'public'              => false,
        'exclude_from_search' => false,
        'publicly_queryable'  => false,
        'show_in_nav_menus'   => false,
        'show_ui'             => false
    ));
}

Note: The menu item won’t be permanently deleted. If you remove the code, the menu item will be back again.

You are not using a child theme yet?

If you aren’t using a child theme yet, you can download my pre-built child theme here. Then you can upload the theme under Appearance > Themes and activate it.

After that you need to open the functions.php file via FTP and enter the code there. Then the menu item “Projects ” should disappear from the menu.

Original post: https://www.engagewp.com/remove-projects-post-type-divi-elegant-themes/

Dir hat der Beitrag gefallen? Dann teile ihn gerne!