Display the post in 4 columns and 4 rows in wordpress
I have four categories (They like, recent, popular, all) with 16 posts in each. So, for the They like i would like to show the 15 from the They like category and vice versa for the recent page etc.
Post 1 Post 2 Post 3 Post 4
Post 5 Post 6 Post 7 Post 8
Post开发者_如何转开发 9 Post 10 Post 11 Post 12
Post 13 Post 14 Post 15 Post 16
You can use with the category id:
$query = new WP_Query( 'cat=4' );
or using the category name (but the first one is better)
$query = new WP_Query( 'category_name=staff' );
$query gives you the list of posts (filters applied)
The limit can be defined with "post_count" and the position should be defined by CSS (float:left perhaps). More information about WP_Query on http://codex.wordpress.org/Function_Reference/WP_Query
精彩评论