updating news templating

This commit is contained in:
Antoine M 2023-10-27 14:23:55 +02:00
parent 5d806cad96
commit adce6ca331

View File

@ -2,62 +2,66 @@
get_header();
$args = array(
'meta_key' => '_wp_page_template',
'meta_value' => "template-news.php"
'meta_value' => "template-archive-news.php"
);
$relatedPageTemplatePage = get_pages($args) ? get_pages($args)[0] : null;
?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div class="single-post-container single-post-container--news <?php echo $thematiqueColorSlug ? "single-post-container--" . $thematiqueColorSlug : "" ?>">
<nav class="breadcrumbs_navigation" aria-label="breadcrumbs">
<ol>
<li>
<a href="<?php echo home_url() ?>" title="<?php echo __("Accueil", "homegrade-theme__texte-fonctionnel") ?>">
<img src="<?php echo get_template_directory_uri() . "/resources/img/pictogrammes/icon_house_dark.svg" ?>" alt="">
</a>
</li>
<li>
<a href="<?php echo get_the_permalink($relatedPageTemplatePage) ?>">
<?php echo __("News", "homegrade-theme__texte-fonctionnel") ?>
</a>
</li>
<li>
<a href="<?php echo get_the_permalink(get_the_id()) ?>" aria-current='location'>
<?php echo get_the_title(get_the_id()) ?>
</a>
</li>
</ol>
</nav>
<div class="post-news-page-container">
<?php /* --------
BREADCRUMB
---------------*/ ?>
<nav class="breadcrumbs_navigation" aria-label="breadcrumbs">
<ol>
<li>
<a href="<?php echo home_url() ?>" title="<?php echo __("Accueil", "homegrade-theme__texte-fonctionnel") ?>">
<img src="<?php echo get_template_directory_uri() . "/resources/img/pictogrammes/icon_house_dark.svg" ?>" alt="">
</a>
</li>
<li>
<a href="<?php echo get_the_permalink($relatedPageTemplatePage) ?>">
<?php echo __("News", "homegrade-theme__texte-fonctionnel") ?>
</a>
</li>
<li>
<a href="<?php echo get_the_permalink(get_the_id()) ?>" aria-current='location'>
<?php echo get_the_title(get_the_id()) ?>
</a>
</li>
</ol>
</nav>
<div class="post-news-page-container">
<?php /* --------
HEADING BOX
---------------*/ ?>
<?php
get_template_part("template-components/news-heading-box", null, array(
"news_type" => get_the_terms(get_the_ID(), 'news-type'),
"title" => get_the_title(),
"thumbnail" => get_the_post_thumbnail(get_the_ID(), "full", array('class' => 'news-heading-box__thumbnail')),
"published" => get_the_date()
));
?>
<div class="entry-content single-news-editor-content">
<?php
the_content();
get_template_part("template-components/news-heading-box", null, array(
"news_type" => get_the_terms(get_the_ID(), 'news-type'),
"title" => get_the_title(),
"thumbnail" => get_the_post_thumbnail(get_the_ID(), "full", array('class' => 'news-heading-box__thumbnail')),
"published" => get_the_date()
));
?>
<article class="entry-content single-news-editor-content">
<?php
the_content();
?>
</article>
</div>
</div>
<?php endwhile; ?>
<?php endif; ?>
<?php endwhile; ?>
<?php endif; ?>
<?php
get_footer();
<?php
get_footer();