Filter post by users creation date

Question

I am working on a membership site and my client would like to hide member’s only content from new subscribers. EX. If I create a new member today how can I keep the new member seeing previously created content?

TIA!

in progress 0
Robert Lane 2 months 2021-04-27T11:36:58-05:00 0 Answer 0 views 0

Answer ( 1 )

    0
    2021-04-28T22:47:06-05:00

    You will have to save the time when user registers and then you can update the conditions for displaying posts. Fetch the user’s registration date and use pre_get_posts to modify the query using date_query.

Leave an answer

Browse
Browse