Disable Dashicons on front-end

// —-Disable Dashicons on front-end function wpdocs_dequeue_dashicon() { if (current_user_can( ‘update_core’ )) { return; } wp_deregister_style(‘dashicons’); } add_action( ‘wp_enqueue_scripts’,...

404 to homepage WP

// 404 to homepage add_action(‘wp’, function() { if (!is_admin() && is_404()) { if ( (defined(‘DOING_CRON’) && DOING_CRON) || (defined(‘XMLRPC_REQUEST’) && XMLRPC_REQUEST) ) { return; } if (...

Auto image alt with image title

$(“img”).each(function() { var img_src = jQuery(this).attr(‘src’); if (typeof img_src !== typeof undefined && img_src !== false) { var img_alt = jQuery(this).attr(‘alt’); var str = img_src var pieces =...

Page slug to body class – php

//Page Slug Body Class function add_slug_body_class( $classes ) { global $post; if ( isset( $post ) ) { $classes[] = $post->post_type . ‘-‘ . $post->post_name; } return $classes; } add_filter( ‘body_class’,...

Child THEME

Fichier functions.php Lien fichier myJs.js (à créer) <?php function my_theme_enqueue_styles() { wp_enqueue_style( ‘parent-style’, get_template_directory_uri() . ‘/style.css’ ); } add_action( ‘wp_enqueue_scripts’,...