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
function meta_robots(){ | |
if(is_home() && get_query_var('paged') > 1)){ | |
echo '<meta name="robots" content="noindex,follow" />'."\n"; | |
} | |
} | |
add_action('wp_head', 'meta_robots'); |
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 | |
//le chemin de l'image a ajouter | |
$image_path=''; | |
//le temps d'expiration' | |
$expire= time() - 360000; //valable 1 heure | |
//je vérifie que l'image existe et qu'elle n'est pas expirée | |
if (file_exists ($image_path) && filemtime($image_path) > $expire) | |
{ | |
//si elle existe je ne fais rien | |
} //fin if |
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 | |
//le chemin de l'image a ajouter | |
$image_path=''; | |
//le temps d'expiration' | |
$expire= time() - 360000; //valable 1 heure | |
//je vérifie que l'image existe et qu'elle n'est pas expirée | |
if (file_exists ($image_path) && filemtime($image_path) > $expire) | |
{ | |
//si elle existe je ne fais rien | |
} //fin if |
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 | |
add_action ('save_post','purge_redis'); | |
function purge_redis (){ | |
include ('predis.php'); | |
$redis = new Predis\Client(''); | |
$domain = $_SERVER['HTTP_HOST']; | |
$url = "http://".$_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; | |
$url = str_replace('?r=y', '', $url); |
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
add_filter('lengow_extra_columns', 'lengow_add_extra_columns'); | |
add_filter('lengow_extra_field_value', 'lengow_extra_field_value', null, 3); | |
function lengow_add_extra_columns($extra_columns) { | |
$extra_columns[] = '_product_type_bulb'; | |
//$extra_columns[] = 'additional_field_2'; | |
return $extra_columns; | |
} | |
function lengow_extra_field_value($value, $field, $lengow_product) { |
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 | |
add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' ); | |
function __deactivate_rocket_lazyload_if_page() | |
{ | |
if( is_page(array('guida-alpina','en/biography','jp/watashi-ni-tsuite','en/true-stories/route-dimai-eotvos','storie-vere/via-dimai-eotvos')) ) { | |
add_filter( 'do_rocket_lazyload', '__return_false' ); | |
} | |
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 | |
add_filter( 'wp', '__deactivate_rocket_lazyload_if_product' ); | |
function __deactivate_rocket_lazyload_if_product() | |
{ | |
if( is_singular('product') ) { | |
add_filter( 'do_rocket_lazyload', '__return_false' ); | |
} |
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
add_filter( 'rocket_minify_excluded_external_js', '__rocket_excluded_external_js_236' ); | |
function __rocket_excluded_external_js_236( $excluded_external_js ) { | |
$excluded_external_js[] = 'app.getresponse.com'; | |
return $excluded_external_js; | |
} |
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
add_filter( 'rocket_minify_excluded_external_js', '__rocket_excluded_external_js_236' ); | |
function __rocket_excluded_external_js_236( $excluded_external_js ) { | |
$excluded_external_js[] = 'exemple.disqus.com'; | |
return $excluded_external_js; | |
} |
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 | |
add_filter( 'wp', '__deactivate_rocket_lazyload_if_page' ); | |
function __deactivate_rocket_lazyload_if_page() | |
{ | |
if( is_page('about') ) { | |
add_filter( 'do_rocket_lazyload', '__return_false' ); | |
} |
OlderNewer