I currently use UserPro plugin for WordPress and when a user wants to answer a question (the section is locked to registered users only), when the user clicks on the question the page will display the question and below it gives the username/password boxes for the user to register or login. What I want is to replace that login section with my UserPro login. how can I do that?
Hi,
Please add the code below to wp-content/themes/your-theme-folder/functions.php
add_filter( 'dwqa_get_author_link', 'dwqa_theme_change_user_permalink', 10, 2 ); function dwqa_theme_change_user_permalink($link, $user_id) { global $userpro; if ( $userpro ) { $link = $userpro->permalink($user_id) } return $link; }
Thanks but now I get Parse error: syntax error, unexpected ‘}’Parse error: syntax error, unexpected ‘}’
it is the bracket before the last one in your code. how to fix?
Hi,
Please replace with the code below
add_filter( ‘dwqa_get_author_link’, ‘dwqa_theme_change_user_permalink’, 10, 2 );
function dwqa_theme_change_user_permalink($link, $user_id) {
global $userpro;
if ( $userpro ) {
$link = $userpro->permalink($user_id);
}
return $link;
}
Thanks, it worked!
Well, I did not get the PHP error but the function does not do what I want. I can protect the Ask questions page, that’s not a problem but what I want is that when I click on a question If I am not logged in, the WordPress registration shows below the question. What I want is to display UserPro login/register page I use instead of WordPress. Currently, it still displays the WordPress page. Pls see this link for what I mean
Hi
any feedback on this?
Hi,
Appreciate if you could give me a solution please?
Hi,
You can copy the template answers.php
and
question-submit-form.php
at wp-content/plugins/dw-question-answer-pro/templates/
to wp-content/themes/your-theme-folder/dwqa-templates/
then replace the code following the link below
https://gist.github.com/oryc9x/b31620c9ccfff4b7db42889bacb127be
Shall I keep the previous code you gave me or remove it?
It’s up to you. It doesn’t make any changes.
Thanks, the matter has been resolved and it now works as expected.
You’re welcome. Let me know if there is anything else I can help you with 🙂
Please login or Register to submit your answer