//interdire l'accès aux non admins
add_action( 'current_screen', 'redirect_non_authorized_user' );
function redirect_non_authorized_user() {
// Si t'es pas admin, tu vires
if ( is_user_logged_in() && ! current_user_can( 'manage_options' ) ) {
wp_redirect( home_url() ); // on les redirige vers la home
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 | |
$posts = get_posts(array( | |
'post_type' => 'page', | |
'post_status' => 'publish', | |
'orderby' => 'menu_order', | |
'numberposts' => 999999 | |
)); | |
foreach ( $posts as $post ) | |
{ |
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
# Default backend definition. Set this to point to your content server. | |
backend default { | |
.host = "127.0.0.1"; | |
.port = "8080"; | |
.connect_timeout = 60s; | |
.first_byte_timeout = 60s; | |
.between_bytes_timeout = 60s; | |
.max_connections = 800; | |
} |
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
var userId = 1282926470; | |
var clientId = 'b2c4628sdsdda9900914746bb80f0c4523ef7fa6'; | |
var myurl = "https://api.instagram.com/v1/users/"+userId+"/media/recent/?client_id="+clientId; | |
$.ajax({ | |
dataType: "jsonp", // Pour eviter de prbs avec le cross domaine on met jsonp | |
url: myurl , | |
}).done(function ( data ) { |
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 popunder(url, width, height, name) { | |
// On désactive le popunder sur les sites mobiles | |
if (typeof window.DetectMobileLong == 'function' && typeof window.DetectTierTablet == 'function') { | |
if(DetectMobileLong() || DetectTierTablet() || document.location.href.match(/test_mobile/)) | |
return false; | |
} | |
// On effectue un traitement différent pour Chrome | |
if(navigator.userAgent.match('Chrome')) { | |
// Ouverture de la nouvelle page (Simulation d'un Shift+Clic) |
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
<!DOCTYPE html> | |
<html class="no-js"> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title></title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link href='http://fonts.googleapis.com/css?family=Lato:300,400' rel='stylesheet' type='text/css'> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> |
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 forbidden_url(){ | |
$forbidenUrls = array( | |
'theme-editor.php', | |
'themes.php', | |
'plugin-editor.php', | |
'plugin-install.php', | |
'plugins.php', |
Permet de pouvoir la traduire dans le BO
Dans functions.php faire pour chaque chaine
Il faut tester l'existance de la functions ! Otherwise your site will badly break with a fatal error at next Polylang update (as WordPress deletes the plugin when updtating it).
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
# Use UTF-8 encoding for anything served text/plain or text/html | |
AddDefaultCharset UTF-8 | |
# Force UTF-8 for a number of file formats | |
<IfModule mod_mime.c> | |
AddCharset UTF-8 .atom .css .js .json .rss .vtt .xml | |
</IfModule> | |
# FileETag None is not enough for every server. | |
<IfModule mod_headers.c> |