term_id; } // Query args. $args = array( 'posts_per_page' => apply_filters( 'ocean_related_blog_posts_count', absint( get_theme_mod( 'ocean_blog_related_count', '3' ) ) ), 'orderby' => 'rand', 'post__not_in' => array( get_the_ID() ), 'no_found_rows' => true, 'tax_query' => array( 'relation' => 'AND', array( 'taxonomy' => 'post_format', 'field' => 'slug', 'terms' => array( 'post-format-quote', 'post-format-link' ), 'operator' => 'NOT IN', ), ), ); // If category. if ( 'category' === $term_tax ) { $args['category__in'] = $terms_ids; } // If tags. if ( 'post_tag' === $term_tax ) { $args['tag__in'] = $terms_ids; } // Define image alt text usage status. $srp_seo_set = get_theme_mod( 'ocean_enable_srp_fimage_alt', false ); $srp_seo_set = $srp_seo_set ? $srp_seo_set : false; // Title tag. $tag = 'h3'; $tag = apply_filters( 'ocean_single_related_post_title_tag', $tag ); // Display date. $srp_date = true; $srp_date = apply_filters( 'ocean_related_posts_date', $srp_date ); // Args. $args = apply_filters( 'ocean_blog_post_related_query_args', $args ); do_action( 'ocean_before_single_post_related_posts' ); // Related query arguments. $oceanwp_related_query = new WP_Query( $args ); // If the custom query returns post display related posts section. if ( $oceanwp_related_query->have_posts() ) : // Wrapper classes. $classes = 'clr'; if ( 'full-screen' === oceanwp_post_layout() ) { $classes .= ' container'; } ?>