5, 'post_type' => 'post', 'ignore_sticky_posts' => true, 'post_status' => $post_status, ); $get_featured_posts = new WP_Query( $args ); ?>
1, 'post_type' => 'post', 'ignore_sticky_posts' => true, 'orderby' => 'rand', ); $get_random_post = new WP_Query( $args ); ?>
have_posts() ) : $get_random_post->the_post(); ?>
true, 'update_post_meta_cache' => false, 'update_post_term_cache' => false, 'ignore_sticky_posts' => 1, 'orderby' => 'rand', 'post__not_in' => array( $post->ID ), 'posts_per_page' => 3, ); // Related by categories. if ( 'categories' == get_theme_mod( 'colormag_related_posts', 'categories' ) ) { $cats = wp_get_post_categories( $post->ID, array( 'fields' => 'ids' ) ); $args['category__in'] = $cats; } // Related by tags. if ( 'tags' == get_theme_mod( 'colormag_related_posts', 'categories' ) ) { $tags = wp_get_post_tags( $post->ID, array( 'fields' => 'ids' ) ); $args['tag__in'] = $tags; // If no tags added, return. if ( ! $tags ) { $break = true; } } $query = ! isset( $break ) ? new WP_Query( $args ) : new WP_Query(); return $query; } endif;