Exclude parent category when getting category posts by slug
I wonder if a single typo is messing things up for you? Please try this: $args = array( ‘posts_per_page’ => ‘-1’, ‘orderby’ => ‘ID’, ‘order’ => ‘DESC’, ‘category_name’ => ‘documents’ ); $surveys = get_posts($args); where I replaced category-name with category_name. I know there is ways to exclude categories by ID but I need to use … Read more