restrict viewing photos and article content on a wordpress site

90 Views Asked by At

I have a question, and i hope i am posting in the right place, if this topic belongs to another forum, please guide me where to post it.

the question is: i have a website created with WordPress and i am using the Jupiter theme, i need to hide some content (like hiding the last half of the article in a page) and disable the photos to be enlarged unless the visitor is a registered user, i need to know how to do that, and if there is a plugin to do that, i have tried "layered-popups-for-wordpress" and "optin-content-locker-layered-popups-addon" but they didn't work properly.

3

There are 3 best solutions below

0
On

It might request a lot of effort for you to edit the theme on your own...You can use the_excerpt() insetead of the_content() for display info, and add a rule that only registered members can see, something like if(is_user_logged_in()) { the_content(); } else { the_excerpt(); } Do this while in the loop, of course...

These plugins might help you though

https://wordpress.org/plugins/tags/paid-content

If you're using WPMU might try this one

https://premium.wpmudev.org/project/pay-per-view/

0
On

I don't know of a plugin that does this automatically, but you can do it yourself if you are willing/able to do some minor theme development. Make a child theme of your Jupiter theme, and copy over the file content.php. There will probably be some part of the code that looks like this:

<?php if ( is_search() ) : ?>
    <?php the_excerpt(); ?>
<?php else : ?>
...

Or something like that. The point is, the theme should already be set up to serve excerpted content for a search. You could either simply add code like this:

<?php if ( is_search() || !is_user_logged_in() ) : ?>
    <?php the_excerpt(); ?>
<?php else : ?>
...

Or you could customize what non logged in users are seeing like this:

<?php if ( is_search() ) : ?>
    <?php the_excerpt(); ?>
<?php else if (!is_user_logged_in()) : ?>
    <!-- Your custom code display here -->
<?php endif; ?>

Hope that's helpful!

0
On

In order to hide certain parts of your content with just a simple shortcode you may give "Restrict Anonymous Access" plugin a try:

https://wordpress.org/plugins/restrict-anonymous-access/

Examples:

[member]My restricted content …[/member]

This shortcode can be placed wherever you need to hide something from logged-out users or even users of a certain user role can be addressed:

[member role="author"]My restricted content to users below author role …[/member]