Skip Navigation

[Resolved] A single blog containing elements displayed according to user restrictions

This support ticket is created 3 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 4 replies, has 3 voices.

Last updated by dominiqueM-3 3 years, 10 months ago.

Assisted by: Shane.

Author
Posts
#2090083
logged-in.jpg
not-logged-in.jpg

Tell us what you are trying to do?
Hello, I'm working on the prototype of a site in which there will be some free access posts and private access posts.

These posts will be made from a specific custom post type.

Here is my question:
I wonder if I can make a unique archive page which could mix either free access posts and private posts.
In other words, when a user is not connected he would see only the free access posts and when a user is connected he would see the free access AND the private access posts in the same blog page.

Thank you

#2090311

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+01:00)

Screenshot 2021-06-16 at 11.12.23.png

How do you distinguish between free and private posts?

You can add a conditional block to wrap the output of your archive loop items so that they are only shown to logged-in users with a test of the current user id (see screenshot).

But that would hide *all* posts from guest users. You would need to combine it with some other condition relating to whether the posts were free or private, but the specifics depend on how you implement that.

#2090367

Hi Nigel,

Thank you for your reply.
I am thinking of creating a specific role for connected users.
Could it be working with a test against the user role?

Thank you

#2090747

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screenshot 2021-06-16 at 10.57.00 AM.png

Hi Dominique,

Following up on Nigel's comment, yes you can use the user role as well as there is a conditional output for user role as well, see screenshot.

Thanks,
Shane

#2091249

My issue is resolved now. Thank you!