Custom posts restriction + category/tag

Hello,

Might someone know please whether Custom posts + category/tag restriction is possible with s2Member?

I would want to restrict contect of the calendar on my website where events go as custom posts “/event/…”. But! I would want to restrict access only to future events and to leave past ones in open access for non members.

Is that possible to do at all with s2member plugin?

Thank you!

You say you want to use Categories and/or Tags to restrict these. Does that mean that you will assign either a Category or Tag designating which events are in the past and which are in the future? If so, then yes, you can do what you need to do. I don’t think you even need to restrict access to the .../event/ URI. Just set your access restrictions based on the Category or Tag assigned.

If you are asking whether s2Member can restrict access based on the date for the event, the answer is not without custom code.

Thank you, Pat!

Here is the website http://budapestfreeevents.com/ It might be easier to explain on a concrete example.

All events are custom posts. Events’ categories and tags relate to custom posts either, not to the the regular posts. They are the feature of the calendar plugin I am using (Time.ly). Thus, S2 does not recognise them as categories and tags… S2 recognizes only regular posts categories and tags…

Even if it would… I have massive quantity: some 150 events per month. To change manually category for each event once it has pasted - too labourious.

I was hoping for some elegant automated solution.

You mentioned custom code. Is this something complicated to write? What do you think?

Many thanks for you response and time.

I’m not sure how complicated it would be to write because I’m not familiar with the event plugin you are using. Have you asked for help from the developer of that plugin? If they could add support for Categories (or Tags) then you could probably just write a function to call a cron job to check the dates of events and switch up the category when they go from “future” to “present” to “past”. Then you could just use s2Member’s out-of-the-box functionality to do the content restrictions. Maybe someone in their community has already written code to add functionality for Categories or Tags?

Thank you, Pat.

I have spoken to plugin developers. Solution for my case doesn’t exist at the moment…

If your events are Custom Post Types, it is possible to add support for Categories to those: https://www.google.com/search?q=wordpress+add+category+support+to+custom+post+type&oq=wordpress+add+support+for+categories+to+custom+po&aqs=chrome.1.69i57j0.12080j0j7&sourceid=chrome&ie=UTF-8.

1 Like

Pat, you are a star! THANK YOU!

I have assigned categories to custom posts and have locked all actual events and the calendar page.

All past events I display this way as open custom posts https://budapestfreeevents.com/event/

Not in a calendar format, not quite elegant as I visioned it. But! It is a real here&now SOLUTION that is now in place.

Thank you once again for going that last extra mile with your advice.

1 Like