diff --git a/functions.php b/functions.php index 5bcbf52..f7e616b 100644 --- a/functions.php +++ b/functions.php @@ -76,3 +76,11 @@ foreach(['/es/documentos/page/:paged','/eu/dokumentuak/page/:paged'] as $route) Routes::load('archive-documentos.php', $params, $query, 200); }); } + +// SOLO UNA VEZ +// add_action('init', function() { +// $posts = get_posts(['post_type' => 'opinion', 'numberposts' => -1]); +// foreach ($posts as $post) { +// update_post_meta($post->ID, '_author_alias', 'field_author_alias'); +// } +// }); \ No newline at end of file diff --git a/src/StarterSite.php b/src/StarterSite.php index f7f01f3..551925d 100644 --- a/src/StarterSite.php +++ b/src/StarterSite.php @@ -479,13 +479,23 @@ class StarterSite extends Site { //Para Footer $context['lasts_posts_news'] = $this->getLastsPostsNews(); $context['last_posts_opinion'] = $this->getLastPostOpinion(); - + //otros $context = array_merge($context, $this->getPolylangData()); - + $context['opinion_url'] = $this->getOpinionUrl($context['current_language']); return $context; } + public function getOpinionUrl($current_lang) + { + if ($current_lang === 'es') { + return "/".$current_lang."/opinion"; + } else { + return "/".$current_lang."/iritzia"; + } + + } + /** * Funciones public 'Template-Portada' */ diff --git a/views/partials/section-videos&opinion.twig b/views/partials/section-videos&opinion.twig index 55eb974..5f09d6a 100644 --- a/views/partials/section-videos&opinion.twig +++ b/views/partials/section-videos&opinion.twig @@ -116,8 +116,9 @@ {# Segunda columna - Último artículo de opinión #}