Hello, there is such a task: the Word Press website has entries with galleries and videos. The user enters the site and can only get acquainted with the thumbnails, the full video and all photos from the gallery are available only after payment via Pay Pal. Tell me how to implement such functionality - when a user buys a subscription for a certain time through Pay Pal, he can see the full record for viewing and just as well on some pages you can see the video in full? Previously, I implemented separately just a payment via Pay Pal and access restriction with a special plugin. Interested in an algorithm of actions in this task. I can not understand which side to approach in order to most easily implement such a functional.

    1 answer 1

    Record pages are rendered using templates. In your case, galleries and videos are most likely custom post types (WordPress custom posts). Such custom types are displayed by templates of the form single-gallery.php. More information about the hierarchy of WordPress templates can be found here .

    In the template file, for example, single-gallery.php, you need to provide for checking the name of the user who is logged in and the status of payment for his subscription. If the subscription is inactive - do not display content.

    • And if the site does not provide authorization? Any user logs in and can subscribe without registering. Without being tied to a user account to something, can a check be tied in this situation? - Simple_Ghost
    • Not authorization, but identification is necessary. I wonder how are you going to distinguish users without identification? Today he comes from Moscow to your site, and tomorrow from Vienna. You look around - and try to see at least one service on the network that requires payment, but does not require identification. And no matter what it is - login / password or authentication through Google / Facebook / Twitter account. - KAGG Design
    • Well, in general, it is logical, thanks. - Simple_Ghost