Momo L
asked 6 years ago

I can see the following line in action.php 
exit( wp_safe_redirect( get_permalink( $new_question ) ) );
but i want to redirect to a different url

Momo L
replied 6 years ago

Any ideas?

2 Answers
DominicStaff
answered 6 years ago

Hello Momo ! 
To redirect users to a different page when user submit a question, please open the actions.php file in the folder path  “/wp-content/plugins/dw-question-answer/inc/actions.php”. Find the line code around line 511:

 exit( wp_safe_redirect( get_permalink( $new_question ) ) );

Then replace with the following code to redirect to home page:

 exit( wp_safe_redirect( home_url() ) );

Notice: you can use similar to redirect user to any other page as you wish !
Hope this helps !

Momo L
replied 6 years ago

ok thankyou dominic

I am now trying to show a success message now instead of redirecting them to a different url. I quite liked the way you show a message. How can i do this please.

DominicStaff
answered 6 years ago
Powered by DW Question & Answer Pro