Created
June 25, 2018 06:53
-
-
Save codersaiful/84011d6639ba8d82b5a7bb16c5eecf31 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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