Hello,
I am trying to use a cloud template on my categories page – but it is not displaying at all.
https://mavjournal.com/wp-content/uploads/2022/12/Screenshot-2022-12-13-at-8.48.19-AM.png
The header doesn’t display, the rest of the category style doesn’t display. The same is on the tag template as well.
Please assist.
Hello @nateb2127!
In order to avoid misunderstandings, please provide more information(screenshots/video) about what exactly you need to achieve or what is the issue there and your website link.
A solution for sending a screenshot/video is this:
Download, capture, and send: https://www.techsmith.com/jing-tool.html
After making the screenshot, you will have a link; paste it here.
Thank you
Thank you for the quick reply.
Okay, so without pictures – I’ve found the problem but can’t understand why. We use Custom Post Types for a lot. In order to get the custom post types to display by default in Categories, and such – I believe this code is needed.. However, this code also breaks that ability for the theme to grab the custom post types and place them into the categories and home page by default..
//Add CPT to Home
add_filter( ‘pre_get_posts’, ‘my_get_posts’ ); function my_get_posts( $query ) { if ( is_home() && $query->is_main_query() ) $query->set( ‘post_type’, array( ‘post’, ‘headlines’, ‘devotional’ ) ); return $query; }
//Add CPT to Category Pages
add_filter(‘pre_get_posts’, ‘query_post_type’);
function query_post_type($query) {
if( is_category() ) {
$post_type = get_query_var(‘post_type’);
if($post_type)
$post_type = $post_type;
else
$post_type = array(‘nav_menu_item’, ‘post’, ‘headlines’,’devotional’, ‘live-blog’); // don’t forget nav_menu_item to allow menus to work!
$query->set(‘post_type’,$post_type);
return $query;
}
}
Hello @nateb2127!
If you have a cloud CPT template, then the header should be applied to this cloud CPT template if that header is global.
Can you explain better the situation you have?
Thank you!