File: /home/.Trash/eurocasa/public_html/wp-content/themes/Divi-child/functions.php
<?php
// Exit if accessed directly
if ( !defined( 'ABSPATH' ) ) exit;
// BEGIN ENQUEUE PARENT ACTION
// AUTO GENERATED - Do not modify or remove comment markers above or below:
add_filter( 'wpseo_show_date_in_snippet_preview', false);
if ( !function_exists( 'chld_thm_cfg_locale_css' ) ):
function chld_thm_cfg_locale_css( $uri ){
if ( empty( $uri ) && is_rtl() && file_exists( get_template_directory() . '/rtl.css' ) )
$uri = get_template_directory_uri() . '/rtl.css';
return $uri;
}
endif;
add_filter( 'locale_stylesheet_uri', 'chld_thm_cfg_locale_css' );
if ( !function_exists( 'chld_thm_cfg_parent_css' ) ):
function chld_thm_cfg_parent_css() {
wp_enqueue_style( 'chld_thm_cfg_parent', trailingslashit( get_template_directory_uri() ) . 'style.css', array( ) );
}
endif;
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 10 );
// END ENQUEUE PARENT ACTION
// MENU REMOVE SECONDARY //
add_filter('wp_nav_menu_objects', 'db105_add_location_class_to_menu', 10, 2);
if (!function_exists('db105_add_location_class_to_menu')) {
function db105_add_location_class_to_menu($menu_items, $args) {
if (is_array($menu_items)) {
foreach($menu_items as $item) {
if (isset($args->theme_location) && isset($item->classes) && is_array($item->classes)) {
$item->classes[] = 'dbdb_'.$args->theme_location;
}
}
}
return $menu_items;
}
}
// END MENU REMOVE SECONDARY //
add_filter( 'ppp_nonce_life', 'my_nonce_life' );
function my_nonce_life() {
return 60 * 60 * 24 * 7; // 5 days
}
//Remove Gutenberg Block Library CSS from loading on the frontend
function smartwp_remove_wp_block_library_css(){
wp_dequeue_style( 'wp-block-library' );
wp_dequeue_style( 'wp-block-library-theme' );
wp_dequeue_style( 'wc-blocks-style' ); // Remove WooCommerce block CSS
}
add_action( 'wp_enqueue_scripts', 'smartwp_remove_wp_block_library_css', 100 );