'post', 'posts_per_page' => 6, 'no_found_rows' => true, 'post_status' => 'publish', // 'update_post_meta_cache' => false, // 'update_post_term_cache' => false, 'post__not_in' => array( $post_id ), 'orderby' => 'rand', 'tax_query' => array( 'relation' => 'OR', array( 'taxonomy' => 'category', 'field' => 'slug', 'terms' => $category_list, ), array( 'taxonomy' => 'post_tag', 'field' => 'slug', 'terms' => $tag_list, ), ), ); } else { $categories = get_the_terms( $post_id, 'category' ); if ( empty( $categories ) || is_wp_error( $categories ) ) { $categories = array(); } $category_list = wp_list_pluck( $categories, 'term_id' ); $related_args = array( 'post_type' => 'post', 'posts_per_page' => 6, 'no_found_rows' => true, 'post_status' => 'publish', // 'update_post_meta_cache' => false, // 'update_post_term_cache' => false, 'post__not_in' => array( $post_id ), 'orderby' => 'rand', 'category__in' => $category_list, ); } return apply_filters( 'kadence_related_posts_args', $related_args ); } /** * Get the related posts args. * * @return array column args. */ function get_related_posts_columns() { if ( kadence()->option( 'post_related_columns' ) ) { if ( kadence()->option( 'post_related_columns' ) == 2 ) { $cols = array( 'xxl' => 2, 'xl' => 2, 'md' => 2, 'sm' => 2, 'xs' => 2, 'ss' => 1, ); } else if ( kadence()->option( 'post_related_columns' ) == 4 ) { $cols = array( 'xxl' => 4, 'xl' => 4, 'md' => 4, 'sm' => 3, 'xs' => 2, 'ss' => 2, ); } else { $cols = array( 'xxl' => 3, 'xl' => 3, 'md' => 3, 'sm' => 2, 'xs' => 2, 'ss' => 1, ); } } else if ( kadence()->has_sidebar() ) { $cols = array( 'xxl' => 2, 'xl' => 2, 'md' => 2, 'sm' => 2, 'xs' => 2, 'ss' => 1, ); } else { $cols = array( 'xxl' => 3, 'xl' => 3, 'md' => 3, 'sm' => 2, 'xs' => 2, 'ss' => 1, ); } return apply_filters( 'kadence_related_posts_carousel_columns', $cols ); } /** * Comment List */ function comments_list() { get_template_part( 'template-parts/content/comments-list' ); } /** * Comment Form */ function comments_form() { comment_form(); } /** * 404 Content. */ function get_404_content() { get_template_part( 'template-parts/content/error', '404' ); }