This file contains 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
add_filter( 'rocket_min_documentRoot', function( $document_root ) { | |
return ABSPATH; | |
} ); |
This file contains 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
function wp_rocket_cache_feed( $uri ) { | |
$feed = '/(.+/)?' . $GLOBALS['wp_rewrite']->feed_base . '/?'; | |
if ( in_array( $feed, $uri ) ) { | |
$uri = array_flip( $uri ); | |
unset( $uri[ $feed ] ); | |
$uri = array_flip( $uri ); | |
} | |
return $uri; | |
} |
This file contains 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 | |
defined( 'ABSPATH' ) || die(); | |
add_action( 'wp_rocket_loaded', function() { | |
remove_filter( 'delete_transient_wc_products_onsale', 'wp_suspend_cache_invalidation' ); | |
}); |
This file contains 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
// ================================================================================== // | |
// # Document on Ready | |
// # Document on Resize | |
// # Document on Scroll | |
// # Document on Load | |
// # Header Settings |
This file contains 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
<div itemscope itemtype="http://schema.org/WebSite"> | |
<meta itemprop="url" content="<?php esc_url( echo home_url( '/' ) ); ?>"/> | |
<form itemprop="potentialAction" itemscope itemtype="http://schema.org/SearchAction" role="search" method="get" id="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<div> | |
<label class="visually-hidden" for="s"><?php _e( 'Search for:', 'themeslug' ); ?></label> | |
<meta itemprop="target" content="<?php esc_url( echo home_url( '/' ) ); ?>?s={s}"/> | |
<input itemprop="s" type="search" value="<?php the_search_query(); ?>" name="s" id="s" class="searchfield" placeholder="<?php _e( 'Input search terms', 'themeslug'); ?>" /> | |
<input type="submit" id="searchsubmit" class="searchsubmit" value="<?php _e( 'Search' ); ?>" /> | |
</div> | |
</form> |
This file contains 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
add_filter( 'rocket_cache_reject_ua', 'wprocket_remove_fb_ua' ); | |
function wprocket_remove_fb_ua( $ua ) { | |
if ( in_array( 'facebookexternalhit', $ua ) ) { | |
$ua = array_flip( $ua ); | |
unset( $ua[ 'facebookexternalhit' ] ); | |
$ua = array_flip( $ua ); | |
} | |
return $ua; | |
} |
This file contains 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 | |
defined( 'ABSPATH' ) or die( 'Cheatin\' uh?' ); | |
/** | |
* Remove expiration on HTML to prevent issue with Varnish cache | |
* | |
* @author Remy Perona | |
* | |
* @param string $rules htaccess rules. | |
* @return Updated htaccess rules |