Latest post by category

Please visit Source Site
#wordpress #wp #php #snippet #coding
// WP_Query arguments $args = array( ‘nopaging’ => false, ‘posts_per_page’ => ‘1’, ‘ignore_sticky_posts’ => false, ‘tax_query’ => array( array( ‘taxonomy’ => ‘category’, ‘terms’ => array( ‘1’, ‘ 2’ ), ), ), ); // The Query $post_by_cat = new WP_Query( $args ); // The Loop if ( $post_by_cat->have_posts() ) { while ( $post_by_cat->have_posts() ) { $post_by_cat->the_post(); […]
The post Latest post by category appeared first on GenerateWP.
Please visit Source Site