Enable sticky posts to custom post_type

i have this custom post_type: tvr_apartment

function custom_post_apartment() {
        $labels = array(
            'name'                => 'Apartments',
            'singular_name'       => 'Apartment',
            'add_new'             => 'Add New',
            'add_new_item'        => 'Add New Apartment',
            'edit_item'           => 'Edit Apartment',
            'new_item'            => 'New Apartment',
            'all_items'           => 'All Apartments',
            'view_item'           => 'View Apartment',
            'search_items'        => 'Search Apartments',
            'not_found'           => 'No apartments found',
            'not_found_in_trash'  => 'No apartments found in trash',
            'parent_item_colon'   => '',
            'menu_name'           => 'Apartments'
        );

        $args = array(
            'labels' => $labels,
            'public' => true,
            'query_var' => true,
            'rewrite' => true,
            'capability_type' => 'post',
            'has_archive' => true,
            'hierarchical' => false,
            'menu_position' => null,
            'taxonomies' => array('rf_apartment_feature'),
            'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt' )
        );

        register_post_type( 'tvr_apartment', $args );
    }

And I would like to enable the sticky post functionality to it,

enter image description here

I searched here:
http://codex.wordpress.org/Function_Reference/post_type_supports

But i it seems is not the way to go, any ideas?

5 s
5

According to extensive and long running trac ticket #12702, custom post types don’t (and likely won’t) support sticky functionality.

It’s probably not impossible to reuse it (with unholy amount of copy paste and edge cases) for CPT in custom site, but in my opinion custom solution (probably custom fields based) would be more practical and clean approach.

Leave a Comment