CPT Preview not working
-
I had (long ago) asked here about a CPT that was not allowing a post to be previewed.
I did find an answer at:
https://wpmudev.com/forums/topic/preview-option-doesnt-work-for-custom-post-types/
So, in:
$args = array( 'label' => __( 'Faqs', 'text_domain' ), 'description' => __( 'Faqs', 'text_domain' ), 'labels' => $labels, 'hierarchical' => false, 'public' => true, 'publicly_queryable' => true, 'show_ui' => true, 'show_in_menu' => true, 'show_in_nav_menus' => true, 'show_in_admin_bar' => true, 'supports' => array( 'title', 'editor', 'author', 'thumbnail', 'excerpt', 'trackbacks', 'custom-fields', 'comments', 'revisions', 'page-attributes', 'post-formats', ), 'taxonomies' => array('faq_category','post_tag'), 'update_count_callback' => '_update_post_term_count', 'menu_position' => 5, 'menu_icon' => null, 'can_export' => true, 'has_archive' => true, 'exclude_from_search' => false, 'publicly_queryable' => true, 'capability_type' => 'post', 'query_var' => 'qa_faqs', 'rewrite' => array('slug' => 'faqs'), );
just remove one line:
'post-formats',
and the preview works!
Is there a better work around?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘CPT Preview not working’ is closed to new replies.