87 lines
2.3 KiB
PHP
Executable File
87 lines
2.3 KiB
PHP
Executable File
<?php
|
|
/**
|
|
* Theme functions and definitions
|
|
*
|
|
* @package HelloElementorChild
|
|
*/
|
|
|
|
/**
|
|
* Load child theme css and optional scripts
|
|
*
|
|
* @return void
|
|
*/
|
|
|
|
require_once 'php/disable-comments.php';
|
|
|
|
function hello_elementor_child_enqueue_scripts() {
|
|
wp_enqueue_style(
|
|
'hello-elementor-child-style',
|
|
get_stylesheet_directory_uri() . '/style.css',
|
|
[
|
|
'hello-elementor-theme-style',
|
|
],
|
|
'1.0.0'
|
|
);
|
|
wp_enqueue_script('tarteaucitron-js',get_stylesheet_directory_uri().'/tarteaucitron/tarteaucitron.js',NULL,NULL,false);
|
|
wp_enqueue_script('head-js',get_stylesheet_directory_uri().'/js/head.js',array('tarteaucitron-js'),NULL,false);
|
|
wp_enqueue_script('footer-js',get_stylesheet_directory_uri().'/js/footer.js',array('tarteaucitron-js','head-js'),NULL,true);
|
|
}
|
|
add_action( 'wp_enqueue_scripts', 'hello_elementor_child_enqueue_scripts' );
|
|
|
|
/** Remove divi shortcode crap **/
|
|
|
|
function remove_divi_shortcodes( $content ) {
|
|
$content = preg_replace('/\[\/?et_pb.*?\]/', '', $content);
|
|
return $content;
|
|
}
|
|
add_filter('the_content', 'remove_divi_shortcodes', 20, 1);
|
|
|
|
/********** Autres personnalisations **********/
|
|
|
|
add_action( 'customize_register', 'edeclic_customizer_settings' );
|
|
|
|
function edeclic_customizer_settings( $wp_customize ) {
|
|
|
|
/*Référencement*/
|
|
$wp_customize->add_section( 'seo' , array(
|
|
'title' => 'Référencement',
|
|
'priority' => 50,
|
|
'capability' => 'administrator'
|
|
) );
|
|
|
|
$wp_customize->add_setting( 'seo_analytics' , array(
|
|
'default' => '',
|
|
'transport' => 'refresh',
|
|
) );
|
|
|
|
$wp_customize->add_control( 'seo_analytics', array(
|
|
'label' => 'Google Analytics',
|
|
'section' => 'seo',
|
|
'type' => 'textarea',
|
|
) );
|
|
|
|
$wp_customize->add_setting( 'seo_manager_header' , array(
|
|
'default' => '',
|
|
'transport' => 'refresh',
|
|
) );
|
|
|
|
$wp_customize->add_control( 'seo_manager_header', array(
|
|
'label' => 'Tag Manager Header',
|
|
'section' => 'seo',
|
|
'type' => 'textarea',
|
|
) );
|
|
|
|
$wp_customize->add_setting( 'seo_manager_body' , array(
|
|
'default' => '',
|
|
'transport' => 'refresh',
|
|
) );
|
|
|
|
$wp_customize->add_control( 'seo_manager_body', array(
|
|
'label' => 'Tag Manager Body',
|
|
'section' => 'seo',
|
|
'type' => 'textarea',
|
|
) );
|
|
|
|
}
|
|
?>
|