Last active
December 25, 2016 10:57
-
-
Save Yeadh/d4be83b894ac89c2fc46ef3be764a0ca to your computer and use it in GitHub Desktop.
Displaying Post by it's category
This file contains 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 | |
$firstcategory = new WP_Query(array( | |
'type'=> 'post', | |
'posts_per_page'=> 3, | |
'category_name'=> 'football', | |
) | |
); | |
while ($firstcategory ->have_posts()) : $firstcategory -> the_post(); ?> | |
<?php the_title(); ?> | |
<?php the_content(); ?> | |
<?php endwhile; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment