Wordpress query posts by tag and category
问题 I'm trying to create a set of WP pages with indices to all posts which have tag X as well as category Y. I found this which seems to do exactly what I want and I understand how to edit it for each index page, but I don't know where/how to use the actual code to create the index pages. global $wp_query; $args = array( 'category__and' => 'category', 'tag__in' => 'post_tag', //must use tag id for this field 'posts_per_page' => -1); //get all posts $posts = get_posts($args); foreach ($posts as