I am using wp emember for my membership site and want to use this plugin and its addons for that and other member sites.
Unfortunately the comments arent hidden - this plugin ignores emember code that hides the native WP comment forms. I'm sure someone has asked about membership sites before. Any ideas?
Hi @igkteam,
Could you please navigate to Dashboard > Comments > Forums admin page, make sure you've disabled commenting for all other roles. More info here:
Thanks @astghik, the comment form is publicly visible on a protected page. Take a look at my screenshot and settings.
ok @igkteam,
I'm sorry, but we don't familiar with this plugin. This depends on how the plugin disabled the comments.
We can debug and try to find some solution for you if you install and activate the Duplicator — WordPress Migration Plugin, backup your WordPress site and send it to info[at]gvectors.com email address to allow us to check it.
Thank you @Astghik. What membership plugins does this system work with well?
I'm sorry, I can't send you a copy of my site, but is there a place you can direct me in the plugin code to make those edits myself?
no problem @igkteam,
just make sure the function that shows/hides the comments use the comments_template() function. I mean that the manipulations should be done with this function.
I've found some articles that should be helpful for you, please check them out:
https://barn2.co.uk/password-protect-wordpress-plugins/
https://wordpress.org/support/article/using-password-protection/
https://themeisle.com/blog/password-protect-wordpress/
Hi @Astghik,
Just wanted to loop back with a solution on this in case someone else has a similar issue. (The links you provided weren't helpful. They were not about protecting content using membership sites.)
The way to solve this is to create unique loops for all the pages (single.php and archive.php) and to hide the comment form behind the code that checks if user is logged in.
In my case, I use Genesis, and this is the code for the single-mycustomposttype.php page (replace mycustomposttype with whatever CPT you've created):
remove_action( 'genesis_loop', 'genesis_do_loop' ); add_action( 'genesis_loop', 'child_do_custom_loop' ); function child_do_custom_loop() { if(wp_emember_is_member_logged_in()){
if (have_posts()) : while (have_posts()) : the_post(); >> output title and content (the html tags here mess with my code, so i'm just posting pseudo code for this bit << comments_template(); //make sure you call it inside the loop, and inside the "if you're logged in" check. endwhile; endif; }else{ header("Location: /"); // I kick people to the login page if they aren't logged in, so there's no partial page view at all. exit();
}
}
genesis();
Thank you @igkteam for sharing the code.
I really appreciate you taking a time and share this information.