{"id":15782,"date":"2025-10-20T09:20:36","date_gmt":"2025-10-20T09:20:36","guid":{"rendered":"https:\/\/www.kadencewp.com\/help-center\/?post_type=docs&#038;p=15782"},"modified":"2026-04-22T16:11:30","modified_gmt":"2026-04-22T16:11:30","password":"","slug":"customize-related-posts-with-kadence_related_posts_args","status":"publish","type":"docs","link":"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-theme\/customize-related-posts-with-kadence_related_posts_args\/","title":{"rendered":"Customizing\u00a0Kadence Related Posts with\u00a0kadence_related_posts_args\u00a0Filter"},"content":{"rendered":"\n<p><br>When you enable <strong><a href=\"https:\/\/www.kadencewp.com\/help-center\/docs\/kadence-theme\/single-post-layout-customizer-settings\/#related-posts\">Related Posts<\/a><\/strong> in Kadence Theme, it will automatically display up to <strong>six related posts<\/strong> that share similar <strong>categories<\/strong> or <strong>tags<\/strong> with the current post.  The current post is excluded, and the results are shown in random order.<\/p>\n\n\n\n<p>If you want to change how many posts appear, what post types are included, or how they are ordered, you can use the <strong>kadence_related_posts_args<\/strong> filter.<\/p>\n\n\n\n<p>This filter lets you control the query Kadence uses to fetch related posts without editing any theme files.<\/p>\n\n\n\n<p>Examples:<\/p>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id15782_e3bc9f-5a .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);}.kb-table-of-content-nav.kb-table-of-content-id15782_e3bc9f-5a .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id15782_e3bc9f-5a .kb-table-of-contents-title{font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id15782_e3bc9f-5a .kb-table-of-content-wrap .kb-table-of-content-list{font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}<\/style>\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading15782_e324cf-51, .wp-block-kadence-advancedheading.kt-adv-heading15782_e324cf-51[data-kb-block=\"kb-adv-heading15782_e324cf-51\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading15782_e324cf-51 mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading15782_e324cf-51[data-kb-block=\"kb-adv-heading15782_e324cf-51\"] 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-heading15782_e324cf-51 img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading15782_e324cf-51[data-kb-block=\"kb-adv-heading15782_e324cf-51\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading15782_e324cf-51 wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading15782_e324cf-51\">Show only posts from the same custom taxonomy and limit to three posts<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_filter( 'kadence_related_posts_args', function( $args ) {\n    $args['tax_query'] = array(\n        array(\n            'taxonomy' =&gt; 'topic',\n            'field'    =&gt; 'slug',\n            'terms'    =&gt; wp_list_pluck( get_the_terms( get_the_ID(), 'topic' ), 'slug' ),\n        ),\n    );\n    $args['posts_per_page'] = 3;\n    $args['orderby'] = 'date';\n    $args['order'] = 'DESC';\n    return $args;\n});<\/code><\/pre>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading15782_3063f5-df, .wp-block-kadence-advancedheading.kt-adv-heading15782_3063f5-df[data-kb-block=\"kb-adv-heading15782_3063f5-df\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading15782_3063f5-df mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading15782_3063f5-df[data-kb-block=\"kb-adv-heading15782_3063f5-df\"] 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-heading15782_3063f5-df img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading15782_3063f5-df[data-kb-block=\"kb-adv-heading15782_3063f5-df\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading15782_3063f5-df wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading15782_3063f5-df\">Show related posts from the same author<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_filter( 'kadence_related_posts_args', function( $args ) {\n    $args['author'] = get_post_field( 'post_author', get_the_ID() );\n    return $args;\n});<\/code><\/pre>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading15782_abd80a-7e, .wp-block-kadence-advancedheading.kt-adv-heading15782_abd80a-7e[data-kb-block=\"kb-adv-heading15782_abd80a-7e\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading15782_abd80a-7e mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading15782_abd80a-7e[data-kb-block=\"kb-adv-heading15782_abd80a-7e\"] 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-heading15782_abd80a-7e img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading15782_abd80a-7e[data-kb-block=\"kb-adv-heading15782_abd80a-7e\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading15782_abd80a-7e wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading15782_abd80a-7e\">Include custom post types<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_filter( 'kadence_related_posts_args', function( $args ) {\n    $args['post_type'] = array( 'post', 'news', 'article' );\n    return $args;\n});<\/code><\/pre>\n\n\n<style>.wp-block-kadence-advancedheading.kt-adv-heading15782_a80839-1b, .wp-block-kadence-advancedheading.kt-adv-heading15782_a80839-1b[data-kb-block=\"kb-adv-heading15782_a80839-1b\"]{font-style:normal;}.wp-block-kadence-advancedheading.kt-adv-heading15782_a80839-1b mark.kt-highlight, .wp-block-kadence-advancedheading.kt-adv-heading15782_a80839-1b[data-kb-block=\"kb-adv-heading15782_a80839-1b\"] 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-heading15782_a80839-1b img.kb-inline-image, .wp-block-kadence-advancedheading.kt-adv-heading15782_a80839-1b[data-kb-block=\"kb-adv-heading15782_a80839-1b\"] img.kb-inline-image{width:150px;vertical-align:baseline;}<\/style>\n<h3 class=\"kt-adv-heading15782_a80839-1b wp-block-kadence-advancedheading\" data-kb-block=\"kb-adv-heading15782_a80839-1b\">Exclude certain categories<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_filter( 'kadence_related_posts_args', function( $args ) {\n    $args['category__not_in'] = array( 10, 25 );\n    return $args;\n});<\/code><\/pre>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you enable Related Posts in Kadence Theme, it will automatically display up to six related posts that share similar categories or tags with the current post. The current post is excluded, and the results are shown in random order. If you want to change how many posts appear, what post types are included, or&#8230;<\/p>\n","protected":false},"author":116562,"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":[405],"doc_tag":[],"knowledge_base":[6],"class_list":["post-15782","docs","type-docs","status-publish","hentry","doc_category-theme-advanced","knowledge_base-kadence-theme"],"year_month":"2026-04","word_count":210,"total_views":"1406","reactions":{"happy":"0","normal":"0","sad":"0"},"author_info":{"display_name":"Bonn","author_link":"https:\/\/www.kadencewp.com\/help-center\/author\/bonnjoelelimanco\/"},"doc_category_info":[{"term_name":"Advanced","term_url":"https:\/\/www.kadencewp.com\/help-center\/knowledge-base\/kadence-theme\/theme-advanced\/"}],"doc_tag_info":[],"knowledge_base_info":[{"term_name":"Kadence Theme","term_url":"https:\/\/www.kadencewp.com\/help-center\/knowledge-base\/kadence-theme\/","term_slug":"kadence-theme"}],"knowledge_base_slug":["kadence-theme"],"taxonomy_info":{"doc_category":[{"value":405,"label":"Advanced"}],"knowledge_base":[{"value":6,"label":"Kadence Theme"}]},"featured_image_src_large":false,"comment_info":0,"_links":{"self":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/15782","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\/116562"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/comments?post=15782"}],"version-history":[{"count":3,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/15782\/revisions"}],"predecessor-version":[{"id":15786,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/docs\/15782\/revisions\/15786"}],"wp:attachment":[{"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/media?parent=15782"}],"wp:term":[{"taxonomy":"doc_category","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/doc_category?post=15782"},{"taxonomy":"doc_tag","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/doc_tag?post=15782"},{"taxonomy":"knowledge_base","embeddable":true,"href":"https:\/\/www.kadencewp.com\/help-center\/wp-json\/wp\/v2\/knowledge_base?post=15782"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}