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 | |
#lier le logo en header à la catégorie | |
add_filter( 'genesis_seo_title', 'child_header_title', 10, 3 ); | |
function child_header_title( $title, $inside, $wrap ) { | |
if(is_singular('post')){ | |
$category_id = get_the_category(); | |
$id = $category_id[0]->term_id; | |
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 | |
/** | |
* Is_bot | |
* traque la présence d'un bot par plage d'ip | |
* | |
* @param string $ip | |
* @param array $array_bots | |
* @return string|false | |
*/ | |
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 | |
#shortcode dans input form | |
add_filter( 'wp_kses_allowed_html', 'allow_tag_in_input', 10, 2 ); | |
function allow_tag_in_input( $allowedposttags, $context ) { | |
if ( $context == 'post' ) { | |
$allowedposttags['input']['value'] = 1; | |
} | |
return $allowedposttags; | |
} |
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 | |
/* | |
CONFIG | |
*/ | |
$get_email = 'Email'; | |
$get_name = 'Name'; | |
$get_referby = 'refby'; | |
$site_name = 'Titre'; | |
$site_slogan = 'Slogan'; |
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
javascript: (function() { | |
function extractHostname(url) { | |
var hostname; | |
if (url.indexOf("://") > -1) { | |
hostname = url.split('/')[2]; | |
} | |
else { | |
hostname = url.split('/')[0]; | |
} |
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
setInterval(function() { window.scrollTo(0, document.body.scrollHeight); }, 5000); | |
__count__=0; | |
jQuery('.Grid-cell .not-following .follow-text').each(function (i, ele) { | |
ele = jQuery(ele); | |
if (ele.css('display')!='block') { | |
console.log('deja suivi:', i); | |
return; | |
} setTimeout(function () { | |
ele.click(); | |
}, __count__++*500); |
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 | |
function spin($txt){ | |
$pattern = '#\{([^{}]*)\}#msi'; | |
$test = preg_match_all($pattern, $txt, $out); | |
if(!$test) | |
return $txt; | |
$a_trouver = array(); | |
$a_remplacer = array(); | |
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 | |
function analyse($ref){ | |
$refe = parse_url($ref); | |
parse_str($refe['query'], $query); | |
$host = $refe['host']; | |
switch ($host){ | |
case (strpos($host, '.google.') !== false): | |
$moteur = "Google"; |
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 | |
/** | |
* Is_bot | |
* traque la présence d'un bot par plage d'ip | |
* | |
* @param string $ip | |
* @param array $array_bots | |
* @return string|false | |
*/ | |
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 | |
function get_search_num($keyword){ | |
$url = sprintf('http://www.google.fr/search?pws=0&hl=fr&q=%s', $keyword); | |
$data = file_get_contents($url); | |
$pattern = sprintf( | |
'/%s(.*?)%s/', | |
preg_quote('Environ'), | |
preg_quote('résultats') | |
); |
OlderNewer