I want to show my custom post type live-blog in the all post listing page ie. http://www.wordpress.com:8080/wp-admin/edit.php
So for that i am using pre_get_posts hook in order to show live-blog and posts together on that page.
function show_custom_post_type_in_listing($query) {
if ( is_admin() && $query->is_main_query() ) {
if ( $query->is_home() || $query->is_archive() || $query->is_feed() ) {
$query->set('post_type', array('post', 'live-blog'));
}
}
}
add_action('pre_get_posts', 'show_custom_post_type_in_listing');
This works well in listing the live-blog in all posts section but it breaks when i filter the posts on the basis of category.
My URL becomes
Here post_type is set to Array which gives invalid post type.
Is there any way to fix this