show protected posts in blog archive

I would like users of a site to see a preview of the content (i.e. show the archive pages with all the posts) and then when they click to view a post they will be restricted and redirected to the protected content page ...

Currently no protected posts show on archive pages so it looks as if there is no content.

But however there is one workaround which you can use to let display protected posts on blog archive page. You can create shortcode which will render archive page post lists and then you can inject that shortcode to particular page, finally you need to make that page as blog listing archive page.

Here is sample code with steps you can use to understand solution better.

#1) Paste this shortcode code snippet in your current theme's functions.php file, or better you can create child theme or stand-alone plugin for this too.

I have another site with the previous version of the membership plugin and it had this behaviour ... it's the ideal implementation for a membership site as it allows users to see what they're getting access to before they sign up ..

the theme on our site has a number of different blog archive layouts which also get placed on our homepage in blocks .... how can I keep those layouts and use your filter on these to allow posts to show ..

UPDATE: i pasted that into my child theme functions.php and it crashed the site .. i had to remove it.

I have found a temporary solution to achieve my goal, but it's not ideal .. here's what I have done.

I have opened up the post categories for public access, and then overridden those permissions with URL protection .. This allows the posts to be visible on archive pages and within blog widgets etc etc but when a user tries to view them the URL protection kicks in.

I am glad that you found this nice workaround for your problem. And sorry that my solution crashed you site. It was working fine on my sandbox site, there must be another reason for such crashing. And I don't see any problem with your solution so you can go on with your flow. :slight_smile:

Just for anyone coming across this post later (appreciate it's pretty old)... the shortcode code does actually have a mistake in it (missing quotes), see below for a working version to add into functions.php / child theme / plugin:

How do you rate me?

Thank you for rating your experience!

We’re thrilled to hear you had a great experience with . Would you like to leave a comment about your experience?
Thanks for voting on your experience with , we’d love to get some feedback please.
Ohh no! We’re really sorry to hear you didn’t have a pleasant experience with , we’re always looking at how we can improve and would appreciate you provide some further feedback here please.
Type your feedback here

it's great that you had a positive one. Based on your experience in this ticket would you please be kind enough to rate us externally on: