New Landing How can we help? Themeforest Theme Support Neighborhood How can I de-register Custom Post Types (CPT) I don't need?

Viewing 4 posts - 1 through 4 (of 4 total)
  • #31944
    greendiablo
    Member
    Post count: 10

    I’d like to de-register some of the custom post type I don’t need in the child theme (e.g. Jobs, Clients). Or at least hide them from the WordPress backend links, so my client doesn’t get confused by too many options.

    Please help!

    #32297
    Melanie – SUPPORT
    Member
    Post count: 11032

    You can find this code in functions.php

    	/* Add custom post types */
    	require_once(SF_INCLUDES_PATH . '/custom-post-types/portfolio-type.php');
    	require_once(SF_INCLUDES_PATH . '/custom-post-types/team-type.php');
    	require_once(SF_INCLUDES_PATH . '/custom-post-types/clients-type.php');
    	require_once(SF_INCLUDES_PATH . '/custom-post-types/testimonials-type.php');
    	require_once(SF_INCLUDES_PATH . '/custom-post-types/jobs-type.php');
    	require_once(SF_INCLUDES_PATH . '/custom-post-types/faqs-type.php');

    Remove according to your liking

    Cheers

    #32352
    greendiablo
    Member
    Post count: 10

    I’d prefer not to edit the parent theme files.
    I found this code to simply hide the unwanted menus in the admin sidebar:

    /*------------------------------------------*/
    /* Remove Unwanted Admin Menu Items */
    /*------------------------------------------*/
    
    function remove_admin_menu_items() {
    	$remove_menu_items = array(__('Jobs'),__('Portfolio'));
    	global $menu;
    	end ($menu);
    	while (prev($menu)){
    		$item = explode(' ',$menu[key($menu)][0]);
    		if(in_array($item[0] != NULL?$item[0]:"" , $remove_menu_items)){
    		unset($menu[key($menu)]);}
    	}
    }
    
    add_action('admin_menu', 'remove_admin_menu_items');
    #32579
    Melanie – SUPPORT
    Member
    Post count: 11032

    Great 🙂

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in and have valid license to reply to this topic.

License required for one of the following items
Login and Registration Log in · Register