File: /datos/www/expodubai/wp-content/themes/osapa-childOld/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:
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( 'simple-line-icons','font-awesome','pe-icon-7-stroke','owl-carousel','pretty-photo','photoswipe-default','editor-styles' ) );
}
endif;
add_action( 'wp_enqueue_scripts', 'chld_thm_cfg_parent_css', 1000 );
// END ENQUEUE PARENT ACTION
/* Remplazar funcion original del tema padre */
if (!function_exists('osapa_theme_logo')) {
function osapa_theme_logo() {
global $smof_data;
// Obtener el idioma actual
if (function_exists('pll_current_language')) {
$idioma = pll_current_language();
} elseif (defined('ICL_LANGUAGE_CODE')) {
$idioma = ICL_LANGUAGE_CODE;
} else {
$idioma = substr(get_locale(), 0, 2); // Alternativa basada en el locale
}
// Definir la URL del logo según el idioma
if ($idioma == 'en') {
$logo_image = 'https://colombiaexpoosaka.com/wp-content/uploads/2025/03/logo-pais-belleza-eng.png'; // Logo en inglés hardcoded
} else {
$logo_image = isset($smof_data['ftc_logo']['url']) ? esc_url($smof_data['ftc_logo']['url']) : '';
}
$logo_text = isset($smof_data['ftc_text_logo']) ? stripslashes(esc_attr($smof_data['ftc_text_logo'])) : '';
?>
<div class="logo">
<a href="<?php echo esc_url(home_url('/')); ?>">
<!-- Main logo -->
<?php if (!empty($logo_image)): ?>
<img src="<?php echo esc_url($logo_image); ?>" alt="<?php echo !empty($logo_text) ? esc_attr($logo_text) : get_bloginfo('name'); ?>" class="normal-logo" />
<?php endif; ?>
<!-- Logo Text -->
<?php
if (empty($logo_image)) {
echo esc_html($logo_text);
}
?>
</a>
</div>
<?php
}
}
if (!function_exists('osapa_theme_logo_mobile')) {
function osapa_theme_logo_mobile() {
global $smof_data;
// Obtener el idioma actual
if (function_exists('pll_current_language')) {
$idioma = pll_current_language();
} elseif (defined('ICL_LANGUAGE_CODE')) {
$idioma = ICL_LANGUAGE_CODE;
} else {
$idioma = substr(get_locale(), 0, 2);
}
// Definir la URL del logo según el idioma
if ($idioma == 'en') {
$logo_image = 'https://colombiaexpoosaka.com/wp-content/uploads/2025/03/logo-pais-belleza-eng.png'; // Logo en inglés hardcoded
} else {
$logo_image = isset($smof_data['ftc_logo_mobile']['url']) ? esc_url($smof_data['ftc_logo_mobile']['url']) : '';
}
$logo_text = isset($smof_data['ftc_text_logo']) ? stripslashes(esc_attr($smof_data['ftc_text_logo'])) : '';
?>
<div class="logo">
<a href="<?php echo esc_url(home_url('/')); ?>">
<!-- Main logo -->
<?php if (!empty($logo_image)): ?>
<img src="<?php echo esc_url($logo_image); ?>" alt="<?php echo !empty($logo_text) ? esc_attr($logo_text) : get_bloginfo('name'); ?>" class="normal-logo" />
<?php endif; ?>
<!-- Logo Text -->
<?php
if (empty($logo_image)) {
echo esc_html($logo_text);
}
?>
</a>
</div>
<?php
}
}