Merge branch 'ticket28' into develop

This commit is contained in:
Vincent BRIDIER 2021-01-28 15:40:21 +01:00
commit 8a412af89e
5 changed files with 19 additions and 8 deletions

View file

@ -23,11 +23,11 @@
<div class="list-item__description description">
<?php if(!empty($tags)) : ?>
<div class="list-item__tags tags">
<div class="single-news__tag tag tag_<?php echo $tags[0]->slug; ?>"><?php echo ucfirst($tags[0]->name) ?></div>
<div class="single-news__tag tag tag_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>"><?php echo ucfirst($tags[0]->name) ?></div>
</div>
<?php endif; ?>
<div class="list-item__title posts-list__item-title subtitle"><?php the_title(); ?></div>
<div class="list-item__date date date_<?php echo $tags[0]->slug; ?>"><?php echo get_the_date('d / m / Y'); ?></div>
<div class="list-item__date date date_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>"><?php echo get_the_date('d / m / Y'); ?></div>
<div class="list-item__text description"><?php the_excerpt(); ?></div>
<a class="btn list-item__readmore" href="<?php the_permalink(); ?> download" title="Télécharger le document">Télécharger le document</a>
</div>

View file

@ -868,3 +868,14 @@ function remove_menus(){
if (ENV !== ENV_LOCAL){
add_action( 'admin_menu', 'remove_menus' );
}
function str_lreplace($search, $replace, $subject)
{
$pos = strrpos($subject, $search);
if ($pos !== false) {
$subject = substr_replace($subject, $replace, $pos, strlen($search));
}
return $subject;
}

View file

@ -23,11 +23,11 @@
<div class="list-item__description description">
<?php if(!empty($tags)) : ?>
<div class="list-item__tags tags">
<div class="single-news__tag tag tag_<?php echo $tags[0]->slug; ?>"><?php echo ucfirst($tags[0]->name) ?></div>
<div class="single-news__tag tag tag_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>"><?php echo ucfirst($tags[0]->name) ?></div>
</div>
<?php endif; ?>
<div class="list-item__title posts-list__item-title subtitle"><?php the_title(); ?></div>
<div class="list-item__date date date_<?php echo $tags[0]->slug; ?>"><?php echo $date; ?></div>
<div class="list-item__date date date_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>"><?php echo $date; ?></div>
<div class="list-item__text description"><?php the_excerpt(); ?></div>
<a class="list-item__readmore" href="<?php the_permalink(); ?>" title="Lire l’article"><?php _e('Read more', 'LDC Custom string'); ?></a>
</div>

View file

@ -23,7 +23,7 @@
<div class="list-item__description description">
<?php if(!empty($tags)) : ?>
<div class="list-item__tags tags">
<div class="single-news__tag tag tag_<?php echo $tags[0]->slug; ?>">
<div class="single-news__tag tag tag_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>">
<?php foreach ($tags as $k => $tag): ?>
<?php if ($k !== 0): ?>, <?php endif; ?><?php echo ucfirst($tag->name); ?>
<?php endforeach; ?>
@ -31,7 +31,7 @@
</div>
<?php endif; ?>
<div class="list-item__title posts-list__item-title subtitle"><?php the_title(); ?></div>
<div class="list-item__date date date_<?php echo $tags[0]->slug; ?>"><?php echo get_the_date('d / m / Y'); ?></div>
<div class="list-item__date date date_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>"><?php echo get_the_date('d / m / Y'); ?></div>
<div class="list-item__text description"><?php the_excerpt(); ?></div>
<a class="btn list-item__readmore" href="<?= get_permalink(); ?>" title="Lire l’article"><?php _e('Read more', 'LDC Custom string'); ?> <i class="btn__icon btn__icon_arrow-right"></i></a>
</div>

View file

@ -21,7 +21,7 @@
<div class="list-item__description description">
<?php if(!empty($tags)) : ?>
<div class="list-item__tags tags">
<div class="single-news__tag tag tag_<?php echo $tags[0]->slug; ?>">
<div class="single-news__tag tag tag_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>">
<?php foreach ($tags as $k => $tag): ?>
<?php if ($k !== 0): ?>, <?php endif; ?><?php echo ucfirst($tag->name); ?>
<?php endforeach; ?>
@ -29,7 +29,7 @@
</div>
<?php endif; ?>
<div class="list-item__title posts-list__item-title subtitle"><?php the_title(); ?></div>
<div class="list-item__date date date_<?php echo $tags[0]->slug; ?>"><?= get_field('date', $post->ID); ?></div>
<div class="list-item__date date date_<?php echo str_lreplace('-en', '', $tags[0]->slug) ?>"><?= get_field('date', $post->ID); ?></div>
<div class="list-item__text ellipsis description"><?php echo get_the_excerpt(); ?></div>
<a class="list-item__readmore" href="<?php the_permalink(); ?>" title="Lire l’article"><?php _e('Read more', 'LDC Custom string'); ?></a>
</div>