I have the following category layout:
Resources -- Documents
I want to list the posts in the documents category, and have the following code:
$args = array( 'posts_per_page' => '-1', 'orderby' => 'ID', 'order' => 'DESC', 'category-name' => 'documents' ); $surveys = get_posts($args);
This returns the posts in both documents AND resources categories. I only want those in 'documents'.
I know there is ways to exclude categories by ID but I need to use the category slug as my dev and live databases do not match.