Tag Archives: Wp_query()

List All WordPress Posts by Category

If you are looking for a way to automatically generate a post index page, with all the post title & link in a WordPress website, the simple way is to use WP_Query, with “posts_per_page=-1” as $args.

There are ways to organize the list, for example, group the post by Category. In this case, we can add a new parameter in $args, which is “cat”, and put the query inside a category loop. Here are the code snippets.

Continue Reading →