If the content is being output by ACF and not the WordPress post editor, you’ll just need to add some logic to your theme template to get the restrictions to work. Here is our documentation on using Leaky Paywall with ACF.
https://docs.leakypaywall.com/article/46-how-to-hide-custom-fields-behind-leaky-paywall
Thanks for the quick reply, excellent bit of code, I have put that in, unfortunately it still doesn’t seem to be working for me. I have wrapped the whole page template in:
if ( leaky_paywall_user_has_access()) {
PAGE CONTENT HERE
} else { }
And the page content is still displaying when not logged in.
Page visibility is “Only visible to digital access” and Digital Access subscription is Unlimited pages allowed, length forever.
Am I missing something?
Thanks.
OK, scrap that, apologies, it was the caching so I re-enabled the alternative restriction handling.
OK so now that I have used that conditional PHP script, the page is empty, so what would I use to make the nag appear? It just doesn’t look right that the page is empty.
In the “else” part of your code, you could add this to display the subscribe nag.
$restrict = new Leaky_Paywall_Restrictions();
echo $restrict->get_subscribe_nag();
Hi Jeremy
Thanks for the help, I got this to work using your code and have tweaked the settings a bit. Just one more thing, I have wrapped an ACF repeater field with the code to be restricted, but the client wants just a tiny bit of the top of the table to be visible before the nag, I thought this may be what the “Lead in Elements” was for but this doesn’t seem to be having an effect, I set it to 20 and still the whole table is hidden.
Is there a way I can just reveal the top 1 or 2 rows before the nag appears?
You can see the page here – http://tinyurl.com/76h6neh8
Yes, in your restricted logic just run a loop of the repeater field that only runs 1 or 2 times.