change url opinion and author_Alias
This commit is contained in:
@@ -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');
|
||||
// }
|
||||
// });
|
||||
@@ -482,10 +482,20 @@ class StarterSite extends Site {
|
||||
|
||||
//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'
|
||||
*/
|
||||
|
||||
@@ -116,8 +116,9 @@
|
||||
|
||||
{# Segunda columna - Último artículo de opinión #}
|
||||
<div class="col-lg-4 col-12 opinion-article d-flex flex-column order-1 order-lg-2 ">
|
||||
<a href="{{ opinion_url }}" class="text-decoration-none text-dark" style="width: fit-content;">
|
||||
<h2 class="mb-4 position-relative fs-4 fw-bold sp-module-title">{{ __('Opinión', 'Sindikatua')|upper}}</h2>
|
||||
|
||||
</a>
|
||||
<div class="flex-grow-1 d-flex">
|
||||
{% if last_posts_opinion and last_posts_opinion|length > 0 %}
|
||||
{% for article in last_posts_opinion %}
|
||||
|
||||
@@ -19,7 +19,11 @@
|
||||
<h1 class="article-h1">{{ post.title }}</h1>
|
||||
<p class="blog-author mt-4 mb-3 border-dark border-bottom">
|
||||
<span>{{ __('Autor', 'Sindikatua')}}:</span>
|
||||
<a href="{{ post.author.path }}">{{ post.author.name }}</a>
|
||||
{% if post.post_type == 'opinion' %}
|
||||
<span>{{ post.author_alias }}</span>
|
||||
{% else %}
|
||||
<span>{{ post.author.name }}</span>
|
||||
{% endif %}
|
||||
<span>•</span>
|
||||
<time datetime="{{ post.date|date('Y-m-d H:i:s') }}">{{ post.date }}</time>
|
||||
</p>
|
||||
|
||||
Reference in New Issue
Block a user