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 | |
| // Merci à Garconis : https://gist.github.com/Garconis/34b6be24ee644c024663ef1d2e11e2bb | |
| // Supprime et_add_viewport_meta du wp_head | |
| function remove_divi_actions() { | |
| remove_action( 'wp_head', 'et_add_viewport_meta' ); | |
| } | |
| // Appel de 'remove_divi_actions' pendant l'initialisation de WP | |
| add_action('init','remove_divi_actions'); | |
| // Ajout du nouveau pinch et zoom avec le maximum-scale à 5 |
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 snippet_remove_rel() { | |
| ?> | |
| <script type="text/javascript" id="seo-title-link"> | |
| jQuery(document).ready(function($) { | |
| var $this = $(this); | |
| var $items = $this.find('a.la_classe_css'); | |
| $items.removeAttr('rel'); | |
| }); | |
| </script> | |
| <?php |
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 snippet_javascript() { | |
| ?> | |
| <script type="text/javascript" id="seo-title-link"> | |
| jQuery(document).ready(function($) { | |
| jQuery(".et-pb-arrow-prev").prop('title', 'Précédent'); | |
| jQuery(".et-pb-arrow-next").prop('title', 'Suivant'); | |
| }); | |
| </script> | |
| <?php | |
| } |
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 hook_glink_footer() { | |
| ?> | |
| <script type="text/javascript" id="remove-by-class"> | |
| jQuery(document).ready(function($) { | |
| jQuery(".la_class_a_supprimer").remove(); | |
| }); | |
| </script> | |
| <?php | |
| } | |
| add_action('wp_footer', 'hook_glink_footer', PHP_INT_MAX ); |
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
| // création d'un Shortcode pour afficher la date en français de la dernière modification d'un site WordPress. | |
| // ajoutez ensuite simplement le shortcode [lastupdatedate] à votre widget ou footer | |
| function last_update(){ | |
| global $wpdb; | |
| $wpdb->query("SET NAMES 'utf8', lc_time_names = 'fr_FR'"); | |
| $last_updates = $wpdb->get_results("SELECT DATE_FORMAT(MAX(post_modified), '%W %d %M %Y') as date_maj FROM $wpdb->posts WHERE | |
| (post_type='post' AND post_status='publish') OR ( post_type='page' AND post_status='publish')"); | |
| foreach ($last_updates as $last_update){ | |
| return $last_update->date_maj; |
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
| /** | |
| * Création du shortcode Année en cours. | |
| */ | |
| // utilisez [year] dans vos widgets, pages, articles ou votre footer | |
| function shortcode_year() { | |
| $year = date('Y'); | |
| return $year; | |
| } | |
| add_shortcode('year', 'shortcode_year'); |
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 | |
| /** | |
| * Modifie l'apparence de l'administration pour les administrateurs sauf pour un seul administrateur (CHANGE_PSEUDONYME) | |
| */ | |
| //On récupère les infos sur l'utilisateur | |
| $current_user = wp_get_current_user(); | |
| //On verifie que l'utilisateur connecté est un administrateur dont le pseudonyme n'est pas 'CHANGE_PSEUDONYME' | |
| 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 | |
| /** | |
| * Modify admin rights and appearance except for a specific administrator username (CHANGE_USERNAME) | |
| */ | |
| $current_user = wp_get_current_user(); | |
| //Checking if the current user has the 'administrator' role and their username is not 'CHANGE_USERNAME' | |
| if ( | |
| in_array("administrator", $current_user->roles) && | |
| $current_user->user_login !== "CHANGE_USERNAME" | |
| ) { |
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('woocommerce_paypal_payments_single_product_renderer_hook', function() { | |
| return 'woocommerce_after_add_to_cart_form'; | |
| }); |
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('woocommerce_paypal_payments_single_product_renderer_hook', function() { | |
| return 'woocommerce_after_add_to_cart_button'; | |
| }); |