Felix Norton
asked 9 years ago

I  want to create an Ajax popup login when clicking the “login to ask a question button” instead of directing to the wordpress login.
 
I installed and have set up ZM Login with Ajax, but I still need to figure out where to edit the login button. 
 
Can anyone asset me on this?
 
Kind regards
Felix

Felix Norton
replied 9 years ago

Here is our site:http://stoogle.co.za/qa/You can see we created a Login button on the top left menu at the end.Which opens the AJAX login. I want to make the same functionality happen with the green login to ask a question button.I applied a css class .stoogle-login to the menu item to get the AJAX login to open on click.Thanks!

3 Answers
Cover
answered 9 years ago

Hi Felix,

You can add <div class=”stoogle-login”></div> around the “login to ask a question” button to call ajax login.
Open file template-functions.php in the folder “wp-content\plugins\dw-question-answer\inc”

Find line 586 and replace code 

 $button = '<a href="'.$submit_question_link.'" class="dwqa-btn '.$class.'">'.$label.'</a>';

with

$button = '<div class="stoogle-login"><a href="'.$submit_question_link.'" class="dwqa-btn '.$class.'">'.$label.'</a></div>';

Hope this helps!

Felix Norton
replied 9 years ago

Hi there, thanks so much for your help.It almost worked, it didn’t call the Ajax login on click, it still re-directed to the wp-login page.I only want to call the class when user is not logged in. Otherwise what happens is that the user cannot post a question because once logged in the button gets overridden to become a logout button.So I want to make it work that the Ajax login is called only when “Login to ask a question” is displayed.Any advice?

Cover
answered 9 years ago

Hi Felix
Sorry for my previous help. I don’t think the case : user is looged in.
Please follow new guidelines. Replace line 586 of file template-functions.php with:

if( ! is_user_logged_in() ) {
$button = '<div class="stoogle-login"><a href="'.$submit_question_link.'" class="dwqa-btn '.$class.'">'.$label.'</a></div>';
} else {
$button = '<a href="'.$submit_question_link.'" class="dwqa-btn '.$class.'">'.$label.'</a>';
}
Felix Norton
replied 9 years ago

Awesome thanks, did the trick.

DominicStaff
answered 9 years ago

Unfortunately, our plugin don’t support this issues. However, if you want to have it, we are ready to help you as a custom work with a charge of fee ( about $100/h).
In case that you are still interested in the feature, please kindly let us know, we will check and estimate the time.
Regards,

Powered by DW Question & Answer Pro