{"id":27406,"date":"2025-05-23T08:16:01","date_gmt":"2025-05-23T08:16:01","guid":{"rendered":"https:\/\/bjc.myp.com.es\/news\/"},"modified":"2025-12-23T13:22:11","modified_gmt":"2025-12-23T13:22:11","slug":"news","status":"publish","type":"page","link":"https:\/\/bjc.myp.com.es\/en\/news\/","title":{"rendered":"News"},"content":{"rendered":"<div class=\"et_pb_section_0 et_pb_section et_section_regular et_flex_section\">\n<div class=\"et_pb_row_0 et_pb_row et_flex_row\">\n<div class=\"et_pb_column_0 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone\">\n<div class=\"et_pb_text_0 et_pb_text et_pb_bg_layout_light et_pb_module et_flex_module\"><div class=\"et_pb_text_inner\"><h1>News<\/h1>\n<\/div><\/div>\n<\/div>\n<\/div>\n\n<div class=\"et_pb_row_1 et_pb_row et_flex_row\">\n<div class=\"et_pb_column_1 et_pb_column et-last-child et_flex_column et_pb_css_mix_blend_mode_passthrough et_flex_column_24_24 et_flex_column_24_24_tablet et_flex_column_24_24_phone\">\n<div class=\"et_pb_divider_0 et_pb_divider et_pb_space et_pb_divider_position_top et_pb_module\"><div class=\"et_pb_divider_internal\"><\/div><\/div>\n\n<div class=\"et_pb_code_0 et_pb_code et_pb_module\"><div class=\"et_pb_code_inner\"><div id=\"noticias-dinamicas\"><\/div>\n\n<script>\n  const noticias = {\n    noticia1: 27877,\n    noticia2: 27417,\n    noticia3: 27420,\n    noticia4: 27423,\n    noticia5: 27426,\n    noticia6: 27429,\n    noticia7: 27439,\n    noticia8: 27433,\n    noticia9: 27413,\n    noticia10: 27445\n    \/\/ noticia6: 13240, etc.\n  };\n\n  document.addEventListener(\"DOMContentLoaded\", () => {\n    const container = document.getElementById(\"noticias-dinamicas\");\n    const keys = Object.keys(noticias);\n    let html = \"\";\n\n    keys.forEach((key, index) => {\n      const postID = noticias[key];\n      const contenedorID = `noticia-${postID}`;\n\n      html += `\n        <div id=\"${contenedorID}\" class=\"noticia-wrapper\"><\/div>\n        ${index < keys.length - 1 ? '<hr class=\"divider-noticia\">' : ''}\n      `;\n    });\n\n    container.innerHTML = html;\n\n    keys.forEach(key => {\n      const postID = noticias[key];\n      const contenedor = document.getElementById(`noticia-${postID}`);\n\n      fetch(`\/wp-json\/wp\/v2\/posts\/${postID}`)\n        .then(res => res.json())\n        .then(post => {\n          fetch(`\/wp-json\/wp\/v2\/media\/${post.featured_media}`)\n            .then(imgRes => imgRes.json())\n            .then(img => {\n              const imgURL = img.source_url;\n              const htmlLang = document.documentElement.lang || 'es';\nconst locale = htmlLang.startsWith('en') ? 'en-US' : 'es-ES';\n\nconst fecha = new Date(post.date).toLocaleDateString(locale, {\n  month: 'long',\n  year: 'numeric'\n}).toUpperCase();\n              const resumen = post.excerpt.rendered;\n\n              contenedor.innerHTML = `\n                <div class=\"noticia-custom\">\n                  <div class=\"noticia-img\">\n                    <img decoding=\"async\" src=\"${imgURL}\" alt=\"${post.title.rendered}\" \/>\n                  <\/div>\n                  <div class=\"noticia-contenido\">\n                    <h2>${post.title.rendered}<\/h2>\n                    <p class=\"fecha\">${fecha}<\/p>\n                    <div class=\"resumen\">${resumen}<\/div>\n                    <a class=\"boton-noticia\" href=\"${post.link}\">Read the full article<\/a>\n                  <\/div>\n                <\/div>\n              `;\n            });\n        });\n    });\n  });\n<\/script>\n\n<style>\n.noticia-custom {\n  display: flex;\n  align-items: flex-start;\n  gap: 60px;\n  flex-wrap: wrap;\n  max-width: 1100px;\n  margin: 0 auto;\n  padding: 40px 0;\n}\n.noticia-img {\n  width: 460px;\n  height: 300px;\n  overflow: hidden;\n  flex-shrink: 0;\n}\n\n.noticia-img img {\n  width: 100%;\n  height: 100%;\n  object-fit: cover;\n  display: block;\n}\n\n.noticia-contenido {\n  flex: 1;\n  max-width: 560px;\n}\n.noticia-contenido h2 {\n  color: #4CAF50;\n  font-size: 26px;\n  font-weight: 700;\n  line-height: 1.3;\n  margin-bottom: 15px;\n}\n.noticia-contenido .fecha {\n  font-size: 15px;\n  text-transform: uppercase;\n  color: #333;\n  margin-bottom: 20px;\n}\n.resumen {\n  font-size: 16px;\n  line-height: 1.6;\n  color: #111;\n  margin-bottom: 20px;\n}\n.resumen p {\n  margin: 0;\n}\n.boton-noticia {\n  display: inline-block;\n  background-color: #4CAF50;\n  color: white;\n  padding: 10px 18px;\n  text-decoration: none;\n  border-radius: 4px;\n  font-weight: 500;\n  transition: background 0.2s ease;\n}\n.boton-noticia:hover {\n  background-color: #388e3c;\n}\n.divider-noticia {\n  border: none;\n  border-top: 1px solid #ccc;\n  margin: 30px auto;\n  max-width: 1100px;\n}\n<\/style>\n\n<\/div><\/div>\n<\/div>\n<\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"footnotes":""},"class_list":["post-27406","page","type-page","status-publish","hentry"],"acf":[],"_links":{"self":[{"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/pages\/27406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/comments?post=27406"}],"version-history":[{"count":9,"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/pages\/27406\/revisions"}],"predecessor-version":[{"id":36345,"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/pages\/27406\/revisions\/36345"}],"wp:attachment":[{"href":"https:\/\/bjc.myp.com.es\/en\/wp-json\/wp\/v2\/media?parent=27406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}