Wordpress Themes - WP Forum at BFA

Wordpress Themes - WP Forum at BFA (http://forum.bytesforall.com/index.php)
-   Comments, trackbacks & pings (http://forum.bytesforall.com/forumdisplay.php?f=19)
-   -   Hide Comments from Non-Members? (http://forum.bytesforall.com/showthread.php?t=2998)

christina Aug 16, 2009 06:21 AM

Hide Comments from Non-Members?
 
Ok, I've been searching for days now for the answer to this, at least one for the novice. In WP forums, some say being able to hide comments on posts from public view is a "theme level" thing. Others say there are plug-ins for this. I have yet to find one that offers a simple installation or instructions for modifying a PHP file that make any sense to a beginner.

Am I looking for something that just doesn't exist?!
I'm using a Hidepost plugin to restrict POSTS to registered members, but the comments under those posts are STILL totally PUBLIC (which I don't want!)

Any ideas? Anyone? Anywhere? Ack! :confused:

juggledad Aug 17, 2009 09:50 AM

I confused, you say you want to hide comments from the 'non-members' then you say
HTML Code:

I'm using a Hidepost plugin to restrict POSTS to registered members, but the comments under those posts are STILL totally PUBLIC (which I don't want!)
So are you trying to hide posts and comments from non-members? or what. And when mentioning a plugin, it's nice if you can point to the actual plugin - that is if you hope someone will help you, it would be nice to know just what plugin you are using. :)

christina Aug 17, 2009 10:08 AM

Woops, Sorry.:o The plug-in I'm using to make posts viewable to registered members only is called WP Hide Post. It allows me to put a simple piece of code into each post.
The problem I'm having is that although the actual post (article) is now protected, all the comments made on those posts can still be viewed by anyone, as in they're totally public and I don't want them to be. I want the comments made on posts to be hidden and only viewable if you are a registered member and signed in. Does this make more sense I hope?
I've found some potential solutions in other forums, but those solutions involve some edits to certain PHP files that get way over my head. Was hoping for a similar plug-in to the WP Hide Post that will work for the comments section of each post as well. :confused:

juggledad Aug 17, 2009 04:10 PM

if you swap to the default theme, do the comments show up there also? i.e. is this a theme dependent issue

christina Aug 17, 2009 07:23 PM

When I switch to the WP Default theme, I'm still not finding any settings to hide comments. So you think it's a theme dependent then?
I was starting to think that, so I came to this forum for guidance. :o

juggledad Aug 18, 2009 04:24 AM

if you switched to the default theme and the comments still show up, then it is a plugin issue. (which still might be fixable)
If the comments are gone using the default theme, thene it is an Atahualpa caused issue which will bear a deeper investigation and probably a small fix to a peice of code.

Which case is it?

christina Aug 18, 2009 02:16 PM

When switching to the default, the comments are still showing. Have I overlooked a simple plug-in that I couldn't find on the WP plug-ins Directory when I searched them? Some of those plug-ins require some stuff that's way over my doofus head. I'm grateful that you're still tryin' to help me!

juggledad Aug 18, 2009 05:51 PM

How are you setting things so the post is hidden to non registered users? I don't see any option to do that?

christina Aug 18, 2009 06:43 PM

I found a plug in that does this. The plug-in I'm using to make posts viewable to only registered members only is called WP Hide Post. It allows me to put a simple piece of code into each individual post as I'm creating them. It's a plug-in for that works on a per post basis. It works great for the individual posts themselves, but all the comments that follow my posts, well... those are showing up whether you're a registered member or not.

Since this WP Hide Post works so easily for my posts, I wonder if there's something similar, but I bet something I would have to slip into the PHP main template file? (Just guessing, from what little I've done with PHP so far) I just wouldn't have a clue where in the PHP files to put it.

juggledad Aug 18, 2009 07:06 PM

Right, I get that your using WP Hide Post, but what is the code you are using? The code you put in the post? I installed the plugin, am trying to recreate this issue but need to know exactly what you do to the post.

christina Aug 18, 2009 07:22 PM

Does this help I hope?
http://www.mediaplagues.com/wp-conte.../Picture-4.png
THANK YOU SO MUCH for your patience with me!!!

juggledad Aug 19, 2009 03:29 AM

Well the link to the plugin you sent in post #3 is for 'WP Hide Posts' and the link to the plugin in post #9 is called 'HidePost' and they work differently and have different functions.

Actually there is a very simple way to get this to work without using any plugin. Starting in 3.4, you can control the 'loop' at ATO->Style & edit CENTER COLUMN

To prevent post from showing to users that are not logged in, you can use a php IF with the Wordpress 'is_user_logged_in()' function.

in teh section 'The LOOP', locate the line:
HTML Code:

<?php bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>'); ?>
and change it to:
HTML Code:

<?php if ( is_user_logged_in()) {
        bfa_post_bodycopy('<div class="post-bodycopy clearfix">','</div>');
        }
        else {
                echo '<p><h2>* * * You must be logged in to read the posts* * *</h2></p>';
        }
 ?>

then in the section 'Content BELOW the LOOP' locate the line
HTML Code:

<?php /* Load Comments template (on single post pages, and static pages, if set on options page): */ bfa_get_comments(); ?>
to
HTML Code:

<?php /* Load Comments template (on single post pages, and static pages, if set on options page): */
        if ( is_user_logged_in()) {
                bfa_get_comments();
                } ?>

This should prevent any user who isn't logged in from reading anything but the post titles

Handre Sep 24, 2010 04:18 AM

I use the leave a reply in a guestbook page.

I want to show all comments to everyone, including users that are not logged on.

However, when you are not looged in, the guestbook doesn't show any comment.

What am I doing wrong?

Kind regards,

André

Handre Sep 24, 2010 04:31 AM

Sorry, I have found it.
It was a plugin setting for roles and so on.


All times are GMT -6. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.