{"id":14289,"date":"2025-08-06T23:16:16","date_gmt":"2025-08-06T23:16:16","guid":{"rendered":"https:\/\/www.kadencewp.com\/help-center\/?post_type=docs&#038;p=14289"},"modified":"2026-04-22T16:30:27","modified_gmt":"2026-04-22T16:30:27","password":"","slug":"show-multiple-post-types-post-grid-carousel-block","status":"publish","type":"docs","link":"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-blocks\/show-multiple-post-types-post-grid-carousel-block\/","title":{"rendered":"Customizing the Kadence Blocks Pro Post Grid\/Carousel block&#8217;s Query to show multiple post types"},"content":{"rendered":"\n<p>The Kadence <a href=\"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-blocks\/configure-a-blog-list-with-post-grid-carousel-block\/\" target=\"_blank\" rel=\"noreferrer noopener\">Post Grid\/Carousel block<\/a> has filters and hooks that allow you to customize the output of the block. This guide will explain how to customize the <strong>Kadence Blocks Pro<\/strong> Posts Grid query using the <code><strong>kadence_blocks_pro_posts_grid_query_args<\/strong><\/code> filter. This tutorial will demonstrate how to:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Conditionally modify the query based on the block\u2019s <code>className<\/code><\/li>\n\n\n\n<li>Show <strong>multiple post types<\/strong><\/li>\n<\/ul>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading14289_162187-b5, .wp-block-kadence-advancedheading.kt-adv-heading14289_162187-b5[data-kb-block=\"kb-adv-heading14289_162187-b5\"]{text-align:center;font-size:var(--global-kb-font-size-md, 1.25rem);font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading14289_162187-b5 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading14289_162187-b5[data-kb-block=\"kb-adv-heading14289_162187-b5\"] mark.kt-highlight{font-style:normal;color:#f76a0c;-webkit-box-decoration-break:clone;box-decoration-break:clone;padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.wp-block-kadence-advancedheading.kt-adv-heading14289_162187-b5 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading14289_162187-b5[data-kb-block=\"kb-adv-heading14289_162187-b5\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<p class=\"kt-adv-heading14289_162187-b5 wp-block-kadence-advancedheading has-theme-palette-8-background-color has-background\" data-kb-block=\"kb-adv-heading14289_162187-b5\"><strong>Note:<\/strong>  If you&#8217;re not familiar with adding custom PHP snippets to your site, please see <a href=\"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-theme\/how-to-add-a-custom-filter-or-function-with-code-snippets\/\" target=\"_blank\" data-type=\"docs\" data-id=\"1077\" rel=\"noreferrer noopener\">this document<\/a>.<\/p>\n\n\n\n<p>Not all Post Grid\/Carousel blocks on your site need special query logic. By assigning a custom class, you can <strong>limit the filter to only specific instances<\/strong> of the block. Add the CSS class by going to the <em>Advanced block settings &gt; Advanced tab &gt; Additional CSS class(es) option<\/em>.<\/p>\n\n\n<style>.kb-image14289_1579cd-67 .kb-image-has-overlay:after{opacity:0.3;}<\/style>\n<figure class=\"wp-block-kadence-image kb-image14289_1579cd-67 size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"1299\" height=\"686\" src=\"https:\/\/www.kadencewp.com\/help-center\/wp-content\/uploads\/sites\/14\/2025\/08\/Zight-Recording-2025-08-07-at-07.12.11-AM.gif\" alt=\"\" class=\"kb-img wp-image-14290\" \/><\/figure>\n\n\n\n<p>The sample code snippet is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">add_filter('kadence_blocks_pro_posts_grid_query_args', function($args, $attributes) { \n\n    \/\/ Check if block has a specific class\n    if ( isset($attributes['className']) &amp;&amp; strpos($attributes['className'], 'multiple-postTypes-slider') !== false ) {\n\n        \/\/ Define multiple post types to include in the query\n        $args['post_type'] = array('post', 'pages');\n    }\n\n    return $args; \n\n}, 20, 2);<\/code><\/pre>\n\n\n\n<p>This code will be applied to all Post Grid\/Carousel blocks with a specific CSS class, &#8220;<code>multiple-postTypes-slider<\/code>&#8221; and show posts and pages.<\/p>\n\n\n\n<p>If you need further assistance customizing your Post Grid\/Carousel block query, we&#8217;re here to help! <em><strong><a href=\"https:\/\/www.kadencewp.com\/help-center\/premium-support\/\">Submit a Premium Support Ticket Here<\/a><\/strong><\/em>.<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>The Kadence Post Grid\/Carousel block has filters and hooks that allow you to customize the output of the block. This guide will explain how to customize the Kadence Blocks Pro Posts Grid query using the kadence_blocks_pro_posts_grid_query_args filter. This tutorial will demonstrate how to: Note: If you&#8217;re not familiar with adding custom PHP snippets to your&#8230;<\/p>\n","protected":false},"author":115173,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kadence_starter_templates_imported_post":false,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"doc_category":[420],"doc_tag":[],"knowledge_base":[7],"class_list":["post-14289","docs","type-docs","status-publish","hentry","doc_category-blocks-advanced","knowledge_base-kadence-blocks"],"year_month":"2026-04","word_count":227,"total_views":"2411","reactions":{"happy":"2","normal":"2","sad":"0"},"author_info":{"display_name":"Karla","author_link":"https:\/\/www.kadencewp.com\/help-center\/author\/karla-levelup\/"},"doc_category_info":[{"term_name":"Advanced","term_url":"https:\/\/www.kadencewp.com\/help-center\/knowledge-base\/kadence-blocks\/blocks-advanced\/"}],"doc_tag_info":[],"knowledge_base_info":[{"term_name":"Kadence Blocks","term_url":"https:\/\/www.kadencewp.com\/help-center\/knowledge-base\/kadence-blocks\/","term_slug":"kadence-blocks"}],"knowledge_base_slug":["kadence-blocks"],"taxonomy_info":{"doc_category":[{"value":420,"label":"Advanced"}],"knowledge_base":[{"value":7,"label":"Kadence Blocks"}]},"featured_image_src_large":false,"comment_info":0,"_links":{"self":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/14289","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs"}],"about":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/types\/docs"}],"author":[{"embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/users\/115173"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/comments?post=14289"}],"version-history":[{"count":3,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/14289\/revisions"}],"predecessor-version":[{"id":14294,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/14289\/revisions\/14294"}],"wp:attachment":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/media?parent=14289"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/doc_category?post=14289"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/doc_tag?post=14289"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/knowledge_base?post=14289"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}