Skip to content

Instantly share code, notes, and snippets.

@LPerderiset
LPerderiset / function.php
Created November 23, 2022 06:29
Creation d'un shortcode wordpress pour pour utiliser le fil d'Ariane du plugin NavXT Breadcrumb
function glink_bcn() {
echo '<div class="breadcrumbs" typeof="BreadcrumbList" vocab="https://schema.org/">';
echo bcn_display() . '</div>';
}
add_shortcode('glink_bcn', 'glink_bcn');
@LPerderiset
LPerderiset / wpbdp-navxt-integration.php
Created May 25, 2020 09:31
Plugin pour Intégrer NavXT Breadcrumb Plugin à Business Directory Plugin
<?php
/*
Plugin Name: wpbdp navxt integration
Plugin URI: https://www.glink.fr
Version: 1.0.0
Author: L. Perderiset and Business Directory Team
Description: Better integration of NavXT Breadcrumb Plugin with Business Directory Plugin
Author URI: https://www.glink.fr
*/
// ajoute la nouvelle class au plugin BD APRES la suppression grâce à la priorité 999
add_action('wpbdp_loaded', function(){new WPBDP_NavXT_Integration_glink();}, 999);
// supprime toutes les actions de BD sur le plugin NavXT
add_action( 'wpbdp_loaded', function(){
remove_all_actions('bcn_before_fill');
remove_all_actions('bcn_after_fill');
});
$this->compat = new WPBDP_Compat();
$this->rewrite = new WPBDP__Rewrite();
do_action( 'wpbdp_loaded' );
function __construct() {
add_action( 'bcn_before_fill', array( &$this, 'prepare_state' ) );
add_action( 'bcn_after_fill', array( &$this, 'restore_state' ) );
}
<?php
/**
* @since 3.6.5
*/
class WPBDP_NavXT_Integration{
private $state = array();
private $doing = '';
@LPerderiset
LPerderiset / functions.php
Created October 7, 2019 10:58
Fichier fonctions thème enfant Sparkling
<?php
/**
* On enlève les scripts du thème parent
*/
function sparkling_child_dequeue_script() {
wp_dequeue_script( 'sparkling_scripts' );
}
add_action( 'wp_print_scripts', 'sparkling_child_dequeue_script()', 100 );
/**
@LPerderiset
LPerderiset / style.css
Created October 7, 2019 10:56
Thème enfant Sparkling fichier CSS
/*
Theme Name: Sparkling Child
Theme URI: http://colorlib.com/wp/themes/sparkling
Author: Colorlib
Author URI: http://colorlib.com/
Description: Sparkling is a clean minimal and responsive WordPress theme well suited for travel, health, business, finance, design, art, personal and any other creative websites and blogs. Developed using Bootstrap 3 that makes it mobile and tablets friendly. Theme comes with full-screen slider, social icon integration, author bio, popular posts widget and improved category widget. Sparkling incorporates latest web standards such as HTML5 and CSS3 and is SEO friendly thanks to its clean structure and codebase. It has dozens of Theme Options to change theme layout, colors, fonts, slider settings and much more. Theme is also translation and multilingual ready and is available in Spanish. Sparkling is a free WordPress theme with premium functionality and design.
Version: 1.5.0
Template: sparkling
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/license
@LPerderiset
LPerderiset / functions.php
Created October 7, 2019 10:54
Thème enfant de Sparkling, fichier functions.php
<?php
// On charge les styles parents et enfants
add_action( 'wp_enqueue_scripts', 'theme_enqueue_styles', 20);
function theme_enqueue_styles() {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_dequeue_style('sparkling-style');
wp_enqueue_style( 'child-style',
get_stylesheet_directory_uri() . '/style.css',
array('parent-style')