I've reference this related thread but haven't found a working solution that supports pagination and will exclude entries that have multiple categories.
The code example will not include Category One, but when an entry has Category One and Category Two it will still display because Category Two is included in the cateogries array. Is there a way to still exclude the entry even if it's second category is included?
{# Get all the categories you want to INCLUDE #}
{% set categories = craft.categories({
group: 'categories',
slug: [
'not category-one',
],
limit: null,
}).all() %}
{# Get entries related to your desired categories #}
{% set latestNews = craft.entries({
section: 'news',
relatedTo: categories,
with: ([
['image', {
withTransforms: ['medium']
}]
]),
orderBy: 'postDate desc',
limit: 4
}).all() %}