Seeing as there is no single page or single content template for the News theme, where can I add code to require users to be logged in to see comments?
I know how to require login to comment, but on my previous theme I was able to set it so comments were hidden unless you were logged in.
I don’t see where I can do that in the Genesis/News setup. Would this be something to add to the functions as a filter of some sort?http://maschinetutorials.com
Please paste the code here and i will test it for you. Thanks
Generally it goes in the child themes functions.php file.
I’m not sure what code to actually use at this point, I’m new to the framework previously I was using a different framework where the child themes actually had single.php and page.php files
Wrote this for you and tested in on the Back Country child theme.
Code not displaying? Grab it from Github Gists
That’s why Genesis is so good because you use the child themes functions.php for all your PHP customization and never have to worry about finding or losing it.
Awesome, that worked perfectly, thanks!!
Any way to add a messages that says “you must be logged in to view comments” ?
There’s lots of different ways you can do this:
Here’s one method:
You can also remove the logout link, redirect to a specific url after login or use another tag for loginout.
<?php wp_loginout(); ?>
The topic ‘Hide comments from non users?’ is closed to new replies.
Are you a blogger, web designer, developer, or website owner looking to generate more income?
Promote products for the largest and fastest growing online website platform as part of our affiliate program.