Can you recommend code to add to a plugin or functions.php?
Thank you for your longevity!
]]>Result: I am returned to first, but not to the same next page from which I have opened item.
Is this a known issue?
]]>I would like to consult you with the following goal, not sure if this can be done..
End goal : redirect the user to the previous page (referred page) after login successfully.
As of today : domain.com/blog/abc > click login > go to login page > login successful > domain.com (it will always bring to homepage or any specific url I set in backend)
To be : domain.com/blog/abc > click login > go to login page > login successful > domain.com/blog/abc (it should bring back users to where the user was dynamically)
Is this possible?
Can you please advise on this?
Really appreciate that
]]>This one has the developer add code to theme’s function file (i.e. functions.php):
https://www.thewordcracker.com/en-us/how-to-redirect-to-previous-page-after-login-with-the-ultimate-member-plugin-in-wordpress/
This one has the developer add code to Ultimate Member’s core templates\login.php file:
https://www.2hac.com/help/redirect-to-previous-page-after-login-when-using-ultimate-member-plugin-for-wordpress/
Please let me know the best solution. Prior to deploying Ultimate Member, I was using the Force Login plugin, which gave me this functionality.
]]>how can redirect the user to the previous page after login?
I have already activated “Refresh active page”, but it refreshes the login page, I would want to redirect to the previous page.
Thank you.
Best Regards.
]]>I used this code but for premium content after login it redirects to home url.
for example if I want to read a post it’s required to be logged in and after that it redirects me to home, not to the page i was looking for.
function ag_rcp_login_form_redirect_to_previous( $output, $pairs, $atts, $shortcode ) {
$referer = wp_get_referer();
if ( ! empty( $referer ) ) {
$output['redirect'] = $referer;
}
return $output;
}
add_filter( 'shortcode_atts_login_form', 'ag_rcp_login_form_redirect_to_previous', 10, 4 );
]]>i want to create a button with Maxbuttons plugin that takes the user to the previous (back) page when clicked on it. How do I do this? Btw, I have no experience with Javasript code whatsover.
Kind regards,
Yunis
]]>I just want the “return to shop” button (visible when cart is empty) to return to the previous page.
I have found ways to make “return to shop” return to the previous page, but the code I’ve found all lead to an infinite loop problem in which the cart thinks the “previous page” is also the cart page when it is emptied because that was the “previous page” before it was emptied. Hence, clicking “return to shop” will link right back to the cart.
For example, the code below should have worked if not for the infinite loop problem:
function wc_empty_cart_redirect_url() {
return $_SERVER['HTTP_REFERER'];
}
add_filter( 'woocommerce_return_to_shop_redirect', 'wc_empty_cart_redirect_url' );
Is there a way to accomplish this?
Thank you!
]]>