Notice: These forums are now retired and closed. For active support, please Submit a Ticket or visit our official WordPress.org community pages.
Kadence Theme | Kadence Blocks | Starter Templates | WooCommerce Email Designer | Ascend | Virtue | Pinnacle

Hide public post content unless user is logged in

Home / Forums / Virtue Theme / Hide public post content unless user is logged in

This topic is: Not a support question
[Not a support question]
Posted in: Virtue Theme
May 19, 2019 at 11:20 am

I’m trying to create a private website. I’ve been publishing pages as “private” and that’s working OK, after I figured out how to deal with the menu system.

Unfortunately, when I create private posts, widgets like “latest posts” stop listing any private posts. So I’m publishing posts as public and then trying to hide the content, first by hiding menu items (which I can do), and then making the content disappear on the pages themselves. I don’t mind the titles showing, but I don’t want to show images or text content.

I am able to do this for single posts, by modifying line 69 on content-single.php in my child theme from

the_content(); to
if (is_user_logged_in()){the_content();}

However, I’m trying to eliminate the entries on my blog page, which is showing full posts with readmore links. I’m using the Virtue Premium Blog Template, and thought I could do a similar action for this page by modifying line 52 of content-fullpost.php to be:

if (is_user_logged_in()){the_content($readmore); }

However, this doesn’t seem to do anything.

I did a search for other files which contain “the_content” but couldn’t find anything that seemed relevant.

Suggestions?

  • The forum ‘Virtue Theme’ is closed to new topics and replies.