Skip to content

Instantly share code, notes, and snippets.

@codersaiful
Created June 25, 2018 06:53
Show Gist options
  • Save codersaiful/84011d6639ba8d82b5a7bb16c5eecf31 to your computer and use it in GitHub Desktop.
Save codersaiful/84011d6639ba8d82b5a7bb16c5eecf31 to your computer and use it in GitHub Desktop.
<?php
$cat_number = 2; //Sepcify your category ID here
$your_catname = get_cat_name( $cat_number );
//You can display your cat as your style
$args = array(
//All other here
'cat' => $cat_number,
);
$query = new WP_Query( $args );
$serial = 1; //for specify number 1 loop only, I will increase it inside loop
if ($query->have_posts()) : while ($query->have_posts()): $query->the_post();
/**
* For Thumbs part
*/
if( $serial == 1 ){
//display Thumbs here
}
//Your Other element displya here
$serial++; //serial increasing here
endwhile;
wp_reset_query();
else:
//Nothing found
endif;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment