Site logo

Archived topic

Restricting content using GeneratePress

5 replies · Started by Joe on February 4, 2021

Viewing posts 1–6 of 6

Hi,

I have some custom content types/pages that are for logged in users only. Instead of adding another plugin, I was thinking of using GeneratePress to manage it using a hook in the head. Perhaps hiding 'page-content' with CSS would be a bit weak, but how about a redirect to the login page with the conditions: is logged out, and is page/CPT X or Y etc. The data isn't particularly sensitive - just as long as it keeps most people out.

Could this work?

Many thanks! Joe

Thank you Ying,

That's a better solution, because I'd previously triedan html redirect which still briefly shows the starting page.

I have asked over on that thread, but perhaps you know also: how could I adapt that php for multiple pages? Eg mysite.com/restricted-page/* or even for a content type?

Many thanks! Joe

Hi Joe,

i have replied your reply on that other topic.

Glad to hear that

This archived topic is closed to new replies.