I have 3 post categories (hidden link - hidden link and hidden link), I need that this archive pages become visible only to specifics (differents) user roles.
Category "comunicazioni-breda" to "administrator,editor,author,commerciale_altri_prodotti,commerciale_libro,commerciale_sezionali".
Category "comunicazioni-bremet" to "administrator,editor,author,commerciale_bremet".
Category "comunicazioni-bremet-pers" to "administrator,editor,author,comm_bremet_pers".
How can I set this scenario, assuming that I like actual grafich content in the archive pages (see attachment, it's a masonry)?
Now I haven't set any WordPress archive for the post categories... Can you help me withe the Conditional code (ad update starting from the one in the OLD support ticket) and to where I have to put it?
But, since you plan to use the active theme's own layout for these pages, you'll need to add changes to the theme files too.
For example, the layout for the archive pages can be found in the file named 'archive.php' in the theme. In that file, you can use the conditional tags ( ref: https://codex.wordpress.org/Conditional_Tags ) to see if one of the target category term's archive is being viewed and then use the 'wp_get_current_user' function ( ref: https://developer.wordpress.org/reference/functions/wp_get_current_user/ ) to see if the current user has one of the roles for which access to these posts should be allowed.
Similarly, the code for the blog page should be available in the file named 'index.php'.
Note: If you see these files in the active child theme's folder, use them for this customization. If these files are not in the child theme's folder, copy them from the parent theme's folder into the child theme's folder and then add customizations to those files.
I hope this helps and for more personalized assistance around custom code, you can also consider hiring a professional from our list of recommended contractors: https://toolset.com/contractors/