Skip to content

Instantly share code, notes, and snippets.

View thierrypigot's full-sized avatar

Thierry Pigot thierrypigot

View GitHub Profile
@thierrypigot
thierrypigot / wp-config.php
Created September 19, 2023 15:53
Forcer l'utilisation de SSL
<?php
define('FORCE_SSL_ADMIN', true);
@thierrypigot
thierrypigot / .htaccess
Created September 19, 2023 15:52
Protection du fichier wp-config.php
<files wp-config.php>
order allow,deny
deny from all
</files>
@thierrypigot
thierrypigot / wp-config.php
Created September 19, 2023 15:51
Désactivation de l'édition de fichier
<?php
define('DISALLOW_FILE_EDIT', true);
@thierrypigot
thierrypigot / archive.php
Created June 27, 2023 15:29
WordPress loop
<?php
if ( have_posts() ) :
while ( have_posts() ) : the_post();
// Display post content
endwhile;
endif;
?>
@thierrypigot
thierrypigot / index.html
Created June 23, 2023 08:07
Balise rel
<a href="https://www.wp-assistance.fr" rel="nofollow">Cliquez ici</a>
@thierrypigot
thierrypigot / index.html
Created June 23, 2023 08:06
Ancre en html
<a href="#section1">Aller à la section 1</a>
...
<div id="section1">Ceci est la section 1</div>
@thierrypigot
thierrypigot / index.html
Created June 23, 2023 08:04
Balise a en html
<a href="https://www.wp-assistance.fr">Cliquez ici</a>
@thierrypigot
thierrypigot / functions.php
Last active April 4, 2023 14:32
Custom CF7 select field values
<?php
/**
* Use this CF7 field [select dates_cyril], field name is "dates_cyril"
**/
add_filter( 'wpcf7_form_tag', 'waw_dynamic_select_field_values', 10, 2);
function waw_dynamic_select_field_values ( $scanned_tag, $replace ) {
if ( $scanned_tag['name'] != 'dates_cyril' ) {
@thierrypigot
thierrypigot / compteur-de-vues.php
Created March 31, 2023 08:49
Compteur de vues WordPress
<?php
/*
Plugin Name: Compteur de vues d'articles
Plugin URI: https://example.com/plugins/compteur-de-vues-darticles
Description: Ce plugin permet de compter les vues d'un article ou d'un custom post type.
Version: 1.0
Author: Votre nom
Author URI: https://example.com
License: GPL-2.0+
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
@thierrypigot
thierrypigot / wp-config.php
Last active March 16, 2023 13:40
Activer le mode débogage sans afficher les erreurs à l'écran et les enregistrer dans un fichier à la place
<?php
/** LOG Error **/
// Enable WP_DEBUG mode
define( 'WP_DEBUG', true );
// Enable Debug logging to the /wp-content/debug.log file
define( 'WP_DEBUG_LOG', true );
// Disable display of errors and warnings
define( 'WP_DEBUG_DISPLAY', false );