Forums › Forums › Search & Filter Pro › Post Type Not Working
- This topic has 3 replies, 2 voices, and was last updated 10 years, 2 months ago by Ross.
Viewing 4 posts - 1 through 4 (of 4 total)
-
Anonymous(Private) September 6, 2014 at 6:43 am #4344
The post type below is not working. It shows standard posts instead of the post type.
add_action('init', 'cptui_register_my_cpt_images'); function cptui_register_my_cpt_images() { register_post_type('images', array( 'label' => 'Images', 'public' => true, 'show_ui' => true, 'show_in_menu' => true, 'map_meta_cap' => true, 'hierarchical' => false, 'rewrite' => array('slug' => 'images', 'with_front' => 1), 'query_var' => true, 'has_archive' => true, 'menu_position' => '100', 'supports' => array('title','editor','excerpt','trackbacks','custom-fields','comments','revisions','thumbnail','author','page-attributes','post-formats'), 'taxonomies' => array('category','post_tag'), 'labels' => array ( 'name' => 'Images', 'singular_name' => 'image', 'menu_name' => 'Images', 'add_new' => 'Add image', 'add_new_item' => 'Add New image', 'edit' => 'Edit', 'edit_item' => 'Edit image', 'new_item' => 'New image', 'view' => 'View image', 'view_item' => 'View image', 'search_items' => 'Search Images', 'not_found' => 'No Images Found', 'not_found_in_trash' => 'No Images Found in Trash', 'parent' => 'Parent image', ) ) ); }
Ross Moderator(Private) September 8, 2014 at 1:01 pm #4370Is this related to your other support ticket? Let me know and if not I’ll investigate further.
Thanks
Ross Moderator(Private) September 11, 2014 at 1:45 pm #4548It sounds like either the post type is registered after the search, or it could be some conflict with a post type called images.
Could you try using the same code, but give the post type a different (and unique) name?
Failing that you could try adding a lower/higher priority to your init action:
add_action('init', 'cptui_register_my_cpt_images', 1);
Let me know if any of the above works.
Thanks
-
AuthorPosts
Viewing 4 posts - 1 through 4 (of 4 total)