How to black or whitelist two or more items
White list means that insertion will be enabled for any of the items on the white list, while black list means that insertion will be disabled for any of the items on the black list. Sometimes you may need to use the same list to whitelist some item and blacklist another one at the same time or to blacklist two items at the same time. There are few possible approaches.
In the case one of the items can be expressed as a taxonomy (category, tag, or native WP taxonomy item) you can simply whitelist the first item and then blacklist the second item as taxonomy.
For example, if you need to enable block insertions for posts in Category A but not in Category B (assuming category slugs are
category-b) you can achieve this by whitelisting category
category-a and blacklisting taxonomy
In all cases blacklisting two items from the same list at the same time can be achieved with two blocks. In this example we’ll show how to disable ads for Chrome on AndroidOS. Both parameters (Chrome and AndroidOS) should be configured for the Clients list, however, if we put both items there it will mean that insertion will be disabled for any of the items on the black list and not for both at the same time.
We can achieve this with two blocks. In the first block (Block 1) we’ll define the ad code to be inserted, set black list for client Chrome and enable shortcode (no insertion used – leave it to Disabled). In the second block we’ll use shortcode
[ADINSERTER code="1" ignore="page-type"] as code, define black list for client AndroidOS and automatic insertion as needed. Block 2 (with ad code from Block 1) will not be inserted ONLY when client will not be Chrome on AndroidOS. Of course, when using caching we need to set Dynamic blocks to Client-side insert.
PRO In Ad Inserter Pro you can use CHECK shortcodes and only one block. Use the following code:
[ADINSERTER CHECK client="^Chrome"] AD CODE
and then in the Clients list simply blacklist client AndroidOS. Normally the check attribute
condition="value1, value2" means the same as white list. ^ character in front of the first item means black list, in our case blacklisting Chrome.
You can use multiple CHECK shortcodes for all the available lists inside single block.