Mary P.
asked 10 years ago

Hi,
I need to delete the login box and registration link from my theme.
I set that only administrators can answer. So I don’t need users are logged in, but they still can post a question by email, like anonymous users.

I’ve tried to delete from line 160 to 181 in file inc/template-function.php and lines from 309 to 316 in thesis/dwqa/box.php, but nothing happened.

2 Answers
well wisher
answered 10 years ago

Hi Marry,why dont you try and uncheck the registration process from dashboard>>settings>>anyone can register of wordpress if you dont want anyone to register for your site,or if you really want to remove the form from just answer page the this is what you may be looking for


<h3 class=”dwqa-title”>
<?php
printf(‘%1$s %2$s <a href=”%3$s” title=”%4$s”>%4$s</a> %5$s %6$s’,
__(‘Please login’,’dwqa’),
__(‘or’,’dwqa’),
site_url( ‘wp-login.php?action=register’ ),
__(‘Register’,’dwqa’),
__(‘to’,’dwqa’),
__(‘Submit Answer’,’dwqa’)
);
?>
</h3>
<div class=”login-box”>
<?php wp_login_form( array(
‘redirect’ => get_post_permalink( $question_id )
) ); ?>
</div>

the file you can find the above code is answer.php which can be found in wp-content\plugins\dw-question-answer\inc\templates\default folder
Thanks

Mary P.
replied 10 years ago

Thanks you well wisher, I’ve deleted the code that you gave me in inc/templates/default/answers.php and the login form is no more there! 😀

well wisher
replied 10 years ago

your welcome Mary enjoy 🙂

sb13
answered 10 years ago

Hello, I avoided changing the plugin files by modifying my css through Jetpack. That way any updates will not affect my changes. 1. If anyone is interested in getting rid of the login and registration box that shows open during the Submit a Question area: Add this to your custom css editor: 

.user-email span { display: none; }

This leaves the email field open. And there is no longer a mention of login or registration.
 
2. If anyone is interested in getting rid of the large login box that shows at the bottom of every questions page:

#dwqa-answers .dwqa-title, .login-box, .login-username, .login-password, .login-remember, .login-submit {
display: none; }

Basically, you need to log into wordpress like you normally do as an admin to access and see the text editor box for answering questions.  So far this is working for me. I could run into problems in the future. Let me know if this helps anyone. 

Powered by DW Question & Answer Pro