SQL query to select posts from multiple categories

I would use the built in API like Rarst mentioned. You could do something like this: $just_seven = new WP_Query( array( ‘category__in’ => array( 7 ), ‘category__not_in’ => array( 10 ) ) ); You would then have those items in $just_seven->posts. However, if you MUST use a direct SQL statement, I’d suggest using INNER JOIN … Read more

WordPress 3.2 query_posts and pagination, permalinks issue

From the WP Codex for WP_Query: Show Posts from Current Page Display posts from current page: $query = new WP_Query( ‘paged=’ . get_query_var( ‘page’ ) ); Pagination Note: You should set get_query_var( ‘page’ ); if you want your query to work with pagination. Since WordPress 3.0.2, you do get_query_var( ‘page’ ) instead of get_query_var( ‘paged’ … Read more