echo traduccion("Apartaments in Lisbon", "Apartamentos en Lisboa", "Appartements à Lisbonne", "Apartamentos em Lisboa", "Wohnungen in Lissabon"); ?>
$param_destacados = array(
'limit' => -1,
);
$podDestacado = pods('destacado_home', $param_destacados);
if ($podDestacado->total_found() > 0) : ?>
while ($podDestacado->fetch()) : ?>
$imagen_destacada_ID = get_post_thumbnail_id($podDestacado->id());
echo pods_image( $imagen_destacada_ID, 'medium', 0, array('alt' => 'Baixa House - ' . $podDestacado->display('title')), false ); ?>
echo textoTraducido($podDestacado, "title"); ?>
echo textoTraducido($podDestacado, "texto"); ?>
endwhile; ?>
endif; ?>
echo display_banners_footer(); ?>
echo textoTraducido($home, "titulo_apartamentos"); ?>
if($home->display("titulo_1_seccion") != ""){ ?>
echo textoTraducido($home, "titulo_1_seccion"); ?>
} ?>
if($home->display("imagen_seccion") != ""){ ?>
echo pods_image($home->field('imagen_seccion'), 'large', 0, array('alt' => 'Baixa House - ' . $home->field("imagen_seccion")['post_title']), false); ?>
} ?>
if($home->display("texto_1_seccion") != ""){ ?>
echo textoTraducido($home, "texto_1_seccion"); ?>
} ?>
if($home->display("titulo_banner_2") != ""){ ?>
if($home->display("titular_banner_2") != ""){ ?>
echo textoTraducido($home, "titular_banner_2"); ?>
} ?>
echo textoTraducido($home, "titulo_banner_2"); ?>
if($home->display("texto_banner_2") != ""){ ?>
echo textoTraducido($home, "texto_banner_2"); ?>
} ?>
if($home->display("galeria_banner_2") != ""){ ?>
$imagenes = $home->field('galeria_banner_2');
foreach ($imagenes as $imagen) { ?>
echo pods_image($imagen, 'large', 0, array('alt' => 'Baixa House - ' . $imagen['post_title']), false); ?>
} ?>
} ?>
} ?>
if($home->display("titulo_mascotas") != ""){ ?>
echo textoTraducido($home, "titulo_mascotas"); ?>
} ?>
if($home->display("destacados_blog") != ""){ ?>
$destacados_blog = $home->field('destacados_blog');
foreach ($destacados_blog as $destacado_blog) {
$podPost= pods('post', $destacado_blog['ID']);
// Fecha (en: m.d.Y, resto: d.m.Y)
$lang = function_exists('pll_current_language') ? pll_current_language() : substr(get_locale(), 0, 2);
$ts = get_post_time('U', true, $rel_id);
$fecha_str = ($lang === 'en') ? date('m.d.Y', $ts) : date('d.m.Y', $ts);
// Tags
$tags = get_the_terms($destacado_blog['ID'], 'post_tag');
ob_start();
if (!empty($tags) && !is_wp_error($tags)) : ?>
foreach ($tags as $tag) : ?>
# echo esc_html($tag->name); ?>
endforeach; ?>
endif;
$listado_tags_html = ob_get_clean();
$thumb_id = get_post_thumbnail_id($destacado_blog['ID']); ?>
echo pods_image( $thumb_id, 'medium', 0, array('alt' => 'Baixa House - ' . get_the_title($destacado_blog['ID'])), false ); ?>
echo esc_html($fecha_str); ?>
echo $listado_tags_html; ?>
echo get_the_title($destacado_blog['ID']); ?>
$destacado_rel = get_post_meta($destacado_blog['ID'], 'destacado', true);
if ( !empty($destacado_rel) ) : ?>
echo wp_kses_post($destacado_rel); ?>
endif; ?>
} ?>
} ?>
if($home->display("opiniones_destacadas") != ""){ ?>
$opiniones_destacadas = $home->field('opiniones_destacadas');
foreach ($opiniones_destacadas as $opinion_destacada) {
$podOpinion= pods('opinion', $opinion_destacada['ID']);
// Calcular media en escala 0–10
$vals = [];
foreach (['dormir','limpieza','desayuno','recepcion'] as $k) {
$v = $podOpinion->field($k);
if ($v !== null && $v !== '' && is_numeric($v)) {
$v = (int)$v;
$vals[] = max(0, min(10, $v));
}
}
$avg10 = count($vals) ? array_sum($vals) / count($vals) : 0;
$avg10_int = (int) round($avg10); // 0..10 (pasos de 1 = media estrella) ?>
echo textoTraducido($podOpinion, 'nombre'); ?>
echo textoTraducido($podOpinion, 'pais'); ?>
echo textoTraducido($podOpinion, 'fecha'); ?>
echo textoTraducido($podOpinion, 'texto'); ?>
render_stars($avg10_int); ?>
echo traduccion("Average rating", "Puntuación media", "Note moyenne", "Classificação média", "Durchschnittsbewertung"); ?>
} ?>
} ?>
$paginas_rel = $footer->field('paginas_newsletter');
$page_ids = array();
if ( ! empty($paginas_rel) && is_array($paginas_rel) ) {
foreach ($paginas_rel as $p) {
if (is_array($p) && !empty($p['ID'])) {
$page_ids[] = (int) $p['ID'];
} elseif ($p instanceof WP_Post) {
$page_ids[] = (int) $p->ID;
} elseif (is_numeric($p)) {
$page_ids[] = (int) $p;
}
}
$page_ids = array_values(array_unique($page_ids));
}
if ( !empty($page_ids) && is_page($page_ids) ) : ?>
echo textoTraducido($footer,"titulo_newsletter"); ?>
echo textoTraducido($footer,"subtitulo_newsletter"); ?>
echo do_shortcode('[gravityform id="' . traduccion("1", "2", "3", "4", "5") .'" title="false" ajax="true"]'); ?>
endif; ?>
if ( ! is_page_template( array( 'template-home.php', 'template-apartamentos.php' ) ) ) {
echo display_banners_footer();
} ?>