-
-
Save ac1dr3d/b78ff7cb83431fd392e2ab17f115ecc3 to your computer and use it in GitHub Desktop.
infinite redirect on static front page WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Plugin Name: Fix infinite redirect on static front page | |
* Description: Use this simple plugin to Fix infinite redirect on static front page with some WordPress versions | |
* Plugin URI: https://tielabs.com/ | |
* Author: TieLabs | |
* Author URI: https://tielabs.com | |
* Version: 0.1.0 | |
* License: GPLv2 or later | |
*/ | |
// Thanks to andrewtaylor-1 | |
// https://wordpress.org/support/topic/45-causes-infinite-redirect-on-static-front-page/ | |
function tie_disable_front_page_redirect_madness($redirect_url) { | |
if( is_front_page() ) { | |
$redirect_url = false; | |
} | |
return $redirect_url; | |
} | |
add_filter( 'redirect_canonical', 'tie_disable_front_page_redirect_madness' ); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment