change logo and colors
This commit is contained in:
@@ -9,7 +9,7 @@
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
define( 'GA_THEME_VERSION', '2.0.0' );
|
||||
define( 'GA_THEME_VERSION', '2.1.0' );
|
||||
|
||||
require_once __DIR__ . '/inc/customizer.php';
|
||||
require_once __DIR__ . '/inc/dynamic-css.php';
|
||||
@@ -129,19 +129,45 @@ function ga_tel_link() {
|
||||
return 'tel:+34' . preg_replace( '/\D/', '', ga_info( 'telefono' ) );
|
||||
}
|
||||
|
||||
function ga_brand() {
|
||||
/** SVG del logo (assets/img/logo.svg o logo-mark.svg), en línea para poder recolorearlo con CSS. */
|
||||
function ga_logo_svg( $variant = 'full' ) {
|
||||
static $cache = array();
|
||||
if ( ! isset( $cache[ $variant ] ) ) {
|
||||
$file = get_theme_file_path( 'assets/img/' . ( 'mark' === $variant ? 'logo-mark.svg' : 'logo.svg' ) );
|
||||
$cache[ $variant ] = is_readable( $file ) ? trim( file_get_contents( $file ) ) : '';
|
||||
}
|
||||
return $cache[ $variant ];
|
||||
}
|
||||
|
||||
/**
|
||||
* Marca del sitio.
|
||||
*
|
||||
* @param string $context 'header' o 'footer'.
|
||||
*/
|
||||
function ga_brand( $context = 'header' ) {
|
||||
if ( has_custom_logo() ) {
|
||||
the_custom_logo();
|
||||
return;
|
||||
}
|
||||
printf(
|
||||
'<a class="ga-brand" href="%s" rel="home"><span class="ga-brand__mark">%s</span><span class="ga-brand__name"><b>%s</b><b>%s</b><small>%s</small></span></a>',
|
||||
esc_url( ga_home_url() ),
|
||||
ga_icon( 'mark' ), // SVG estático.
|
||||
$style = 'footer' === $context ? 'full' : ga_opt( 'header', 'logo_style' );
|
||||
$name = sprintf(
|
||||
'<span class="ga-brand__name"><b>%s</b><b>%s</b><small>%s</small></span>',
|
||||
esc_html( ga_opt( 'header', 'brand_line1' ) ),
|
||||
esc_html( ga_opt( 'header', 'brand_line2' ) ),
|
||||
esc_html( ga_opt( 'header', 'brand_line3' ) )
|
||||
);
|
||||
$inner = match ( $style ) {
|
||||
'full' => '<span class="ga-brand__logo">' . ga_logo_svg( 'full' ) . '</span>',
|
||||
'text' => $name,
|
||||
default => '<span class="ga-brand__mark">' . ga_logo_svg( 'mark' ) . '</span>' . $name,
|
||||
};
|
||||
printf(
|
||||
'<a class="ga-brand ga-brand--%s" href="%s" rel="home" aria-label="%s">%s</a>',
|
||||
esc_attr( $style ),
|
||||
esc_url( ga_home_url() ),
|
||||
esc_attr( get_bloginfo( 'name' ) ),
|
||||
$inner // SVG estático del tema y textos escapados.
|
||||
);
|
||||
}
|
||||
|
||||
/* ---------- Ayudantes de animales ---------- */
|
||||
|
||||
Reference in New Issue
Block a user