<?php
/*
 * Loans CPT
 */

// Our custom post type function
function create_loans_cpt() {
 
    register_post_type( 'loans',
    // CPT Options
        array(
            'labels' => array(
                'name' => __( 'Loans' ),
                'singular_name' => __( 'Loan' )
            ),
            'menu_icon' => 'dashicons-welcome-widgets-menus',
            'public' => false,  // it's not public, it shouldn't have it's own permalink, and so on
            'publicly_queryable' => true,  // you should be able to query it
            'show_ui' => true,  // you should be able to edit it in wp-admin
            'exclude_from_search' => true,  // you should exclude it from search results
            'show_in_nav_menus' => false,  // you shouldn't be able to add it to menus
            'has_archive' => false,  // it shouldn't have archive page
            'rewrite' => false,  // it shouldn't have rewrite rules
            'supports' => array('title','thumbnail')
        )
    );
}
// Hooking up our function to theme setup
add_action( 'init', 'create_loans_cpt' );