All custom posts are not showing up

I have a custom post type which is called "scholarship". Archive page for custom post type is disabled. I am using category (Scholarships) which also has subcategories. I have used following code to include CPT in loop.

function add_custom_post_type_to_query( $query ) { if ( $query->is_home() || is_category() && $query->is_main_query() ) {     $query->set( 'post_type', array('post', 'scholarship') ); } } add_action( 'pre_get_posts', 'add_custom_post_type_to_query' ); 

When i use this code, 5 CPT are showing up. Total are 8. CPT in Scholarships-subcategories are not showing up and after putting this code my all menus disappear. I have main menu plus one custom menu in footer. If any one could help please.

Replay

Category: custom post types Time: 2016-07-30 Views: 2

Related post

iOS development

Android development

Python development

JAVA development

Development language

PHP development

Ruby development

search

Front-end development

Database

development tools

Open Platform

Javascript development

.NET development

cloud computing

server

Copyright (C) avrocks.com, All Rights Reserved.

processed in 0.157 (s). 12 q(s)