# Partners and Sponsors Post Type With Levels

> Registers a "Partners" post type for sponsor and partner logos with a Partner Level taxonomy (gold, silver, bronze); entries have no single pages.

- Type: PHP
- Runs: Run everywhere
- Category: [Custom Post Types & Fields](https://wpide.com/library/category/post-types/)
- Tags: custom-post-types, sponsors, logos
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/cpt-partners/

## Code

```php
// Names used in labels and URLs: edit to suit.
$wpide_type = array(
    'name'     => 'partner', // Internal name: lowercase, max 20 characters, never change it once you have content.
    'singular' => 'Partner',
    'plural'   => 'Partners',
    'slug'     => 'partners',
);

add_action( 'init', function () use ( $wpide_type ) {
    $s = $wpide_type['singular'];
    $p = $wpide_type['plural'];

    register_post_type( $wpide_type['name'], array(
        'labels'        => array(
            'name'                  => $p,
            'singular_name'         => $s,
            'menu_name'             => $p,
            'add_new_item'          => "Add New $s",
            'edit_item'             => "Edit $s",
            'new_item'              => "New $s",
            'view_item'             => "View $s",
            'view_items'            => "View $p",
            'all_items'             => "All $p",
            'search_items'          => "Search $p",
            'not_found'             => 'Nothing found.',
            'not_found_in_trash'    => 'Nothing found in Trash.',
            'archives'              => "$s Archives",
            'attributes'            => "$s Attributes",
            'insert_into_item'      => "Insert into $s",
            'uploaded_to_this_item' => "Uploaded to this $s",
            'item_published'        => "$s published.",
            'item_updated'          => "$s updated.",
        ),
        'public'              => false,
        'show_ui'             => true,
        'show_in_nav_menus'   => false,
        'exclude_from_search' => true,
        'publicly_queryable'  => false,
        'has_archive'         => false,
        'rewrite'             => false,
        'show_in_rest'  => true,
        'menu_icon'     => 'dashicons-awards',
        'menu_position' => 36,
        'supports'      => array( 'title', 'excerpt', 'thumbnail', 'page-attributes' ),
    ) );

    register_taxonomy( 'partner_level', $wpide_type['name'], array(
        'labels'            => array(
            'name'          => 'Partner Levels',
            'singular_name' => 'Partner Level',
            'menu_name'     => 'Partner Levels',
            'all_items'     => 'All Partner Levels',
            'edit_item'     => 'Edit Partner Level',
            'view_item'     => 'View Partner Level',
            'update_item'   => 'Update Partner Level',
            'add_new_item'  => 'Add New Partner Level',
            'new_item_name' => 'New Partner Level Name',
            'search_items'  => 'Search Partner Levels',
            'not_found'     => 'No partner levels found.',
            'parent_item'   => 'Parent Partner Level',
        ),
        'hierarchical'      => true,
        'public'            => false,
        'show_ui'           => true,
        'show_admin_column' => true,
        'show_in_rest'      => true,
    ) );
} );
```

## Notes

Use the featured image as the logo and the excerpt for a short blurb.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Partners and Sponsors Post Type With Levels" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
