Logout without confirmation and SAME window on mobile

Try using wp_redirect($url). See https://developer.wordpress.org/reference/functions/wp_redirect/ . So…something like: // set up the URL to redirect to $redirect_to = ‘https://www.example.com/page’; wp_redirect($redirect_to); exit; Note that exit is required to close out the code. See the docs in the above link.

W3 Cache redirects to front page when I press purge all caches

It’s because you have set the Referrer Policy header incorrectly set in the W3TC page cache. Referrer Policy This header restricts the values of the referer header in outbound links. **Directive: same-origin** …will fix it. If your overall Directive is “same-origin” and you set the Referrer header to something different (such as “origin”), this error … Read more

Redirect non existing page to frontpage

You can use conditional tag is_404() and wp action hook to redirect whenever the page can not be found. functions.php add_action( ‘wp’, ‘se344018_redirect_404’ ); function se344018_redirect_404() { if ( is_404() ) { wp_redirect( home_url() ); // // wp_redirect( home_url(‘some/page-slug’) ); exit; } }

Keep subcategory grandson in slug

The problem is not with WordPress — it does generate the proper permalink, be the post assigned to just grandson or son and father. It’s just that for the latter, the “chosen” category could be either son or father, but not both — and if it’s son (which has a parent category), then the permalink … Read more

Redirect Main Home Page url to category URL without plugin

You can use the following code: add_action( ‘request’, function( $request ){ if( empty( $request ) ){ wp_safe_redirect( get_home_url() . ‘/lunchtime-results/’ ); exit; } return $request; }); This can be added to your theme’s functions.php file. The code checks the current request arguments. When visiting the home page the request is empty; in all other cases … Read more

BuddyPress – Redirects on Login and Logout

heres how you login to the profile page. /*Add a filter to filter the redirect url for login*/ add_filter(“login_redirect”,”bpdev_redirect_to_profile”,100,3); function bpdev_redirect_to_profile($redirect_to_calculated,$redirect_url_specified,$user) { /*if no redirect was specified,let us think ,user wants to be in wp-dashboard*/ if(empty($redirect_to_calculated)) $redirect_to_calculated=admin_url(); /*if the user is not site admin,redirect to his/her profile*/ if(!is_site_admin($user->user_login)) return bp_core_get_user_domain($user->ID); else return $redirect_to_calculated; /*if site … Read more