"You can add Access conditionals to a WordPress Archive to control visibility of each post."
Ok, the "archives" are two particular categories: how can I add Access conditionals to this categories?!
Let me make sure I understand. You want to apply Access conditionals in a WordPress Archive, but only for 2 specific taxonomy term archives, is that correct? If so, then you can use nested conditionals like this:
<ul class="wpv-loop js-wpv-loop">
<wpv-loop>
[wpv-conditional if="( '[wpv-taxonomy-archive]' eq 'cat-slug-1' OR '[wpv-taxonomy-archive]' eq 'cat-slug-2' )"]
this is cat slug 1 or cat slug 2
[toolset_access role="Author" operator="deny"]<li>
[wpv-post-link]
[wpv-post-date]
</li>[/toolset_access]
[/wpv-conditional]
[wpv-conditional if="( '[wpv-taxonomy-archive]' ne 'cat-slug-1' AND '[wpv-taxonomy-archive]' ne 'cat-slug-2' )"]
this is not cat slug 1 or cat slug 2
<li>
[wpv-post-link]
[wpv-post-date]
</li>
[/wpv-conditional]
</wpv-loop>
</ul>
The wpv-conditional statements test the current archive term slug. Then inside those conditionals you can apply the Access conditionals as needed.
Here I am.
I use "Articles Group" to filter 2 type of post for different user.
GROUP 1 - 10 post, visibile only to user role 1 and 2
GROUP 2 - 10 post, visibile only to user role 3
And this part works, "role 3" can't view post in group 1.
But... in the BLOG PAGE, all type of roles can view all the "preview" of the post. (image attached)
I add also 2 different categories of this 2 GROUPS (Comunicazioni Breda - Comunicazione Bremet), so maybe we can use the categories to filter the content...
So your conditionals would look something like this:
[wpv-conditional if="( has_term('cat-slug-1', 'category'))"]
this is cat slug 1
[toolset_access role="Author" operator="allow"]<li>
[wpv-post-link]
[wpv-post-date]
</li>[/toolset_access]
[/wpv-conditional]
[wpv-conditional if="( has_term('cat-slug-2', 'category'))"]
this is cat slug 2
[toolset_access role="Editor" operator="allow"]<li>
[wpv-post-link]
[wpv-post-date]
</li>[/toolset_access]
[/wpv-conditional]
Ok, but...
Where i put this “conditional”?
... and also, if I wanna allow more than 1 role, the code it's something like this?
[wpv-conditional if="( has_term('comunicazioni-breda', 'category'))"]
this is cat slug 1
[toolset_access role="administrator,editor,author,commerciale_altri_prodotti,commerciale_libro,commerciale_sezionali" operator="allow"]<li>
[wpv-post-link]
[wpv-post-date]
</li>[/toolset_access]
[/wpv-conditional]
[wpv-conditional if="( has_term('comunicazioni-bremet', 'category'))"]
this is cat slug 2
[toolset_access role="administrator,editor,author,commerciale_bremet" operator="allow"]<li>
[wpv-post-link]
[wpv-post-date]
</li>[/toolset_access]
[/wpv-conditional]
You put this conditional inside a WordPress Archive, inside the Loop. Use it to hide the loop's contents from certain Users. Yes, if you want to allow more than one role you can combine roles in a comma-separated list.