Exclusive content for registered users

Posted in: Newspaper
Post count: 5

Hi, I’m trying to show exclusive content for registered users and I can’t find a way to do it on pages made with TagDiv Composer.

Pass the code that I am using in the functions.php

add_shortcode ('private', 'bp_private_content');

function bp_private_content ($ atts, $ content = null) {
if (is_user_logged_in () &&! is_null ($ content) &&! is_feed ())
return $ content;
return '<p class = "private"> This content is reserved for registered users. Register here to see it. </p> ';}

[private]

Exclusive content for registered users goes between these tags

[/private]

The code is working, in single it works perfectly.

The problem that does not work in the Composer, and I need to implement it in a page.

Thank you, I await your answer!

Post count: 27744

Hello,

Unfortunately, our theme does not have this option, sorry, you’ll need to use a plugin for this.
Maybe one of those will help you:
8 BEST CONTENT RESTRICTION PLUGINS FOR WORDPRESS

Thank you for your understanding!

Viewing 2 posts - 1 through 2 (of 2 total)
The forum ‘Newspaper’ is closed to new topics and replies.