I'm listing out all posts of a custom post type on a page. I want to remove one category from the query as I'm using it to categorize posts with gated content and as such don't want them to display.
Here's my query:
$category = get_cat_ID( 'Gated' ); $exclude = '-'.$category; $args = array( 'post_type' => 'resource', 'posts_per_page' => -1, 'cat' => $exclude, ); $loop = new WP_Query( $args );
But what ends up being
'cat' => -46 doesn't seem to be doing anything at all, the posts Categorized as "Gated" still display.
From what I've read in the codex etc, I feel like I'm doing this correctly. But apparently I'm not? I've run out of different ways to tweak this. Please help!
$exclude prints out the right category ID +
-, and I have tried manually entering the