128 lines
3.7 KiB
PHP
128 lines
3.7 KiB
PHP
<?php
|
|
//Template Name: Article slider
|
|
get_header();
|
|
?>
|
|
|
|
<?php
|
|
$featured_posts = get_field('article');
|
|
|
|
if( $featured_posts ){
|
|
echo '
|
|
<div class="slider__container">
|
|
<div class="container">
|
|
<a id="prevSlide">
|
|
<span class="arrow arrow-left arrow-big"></span>
|
|
</a>
|
|
<div class="trust-slider-container">';
|
|
echo '<ul id="index-trust-slider" class="slider index-trust-slider">';
|
|
foreach( $featured_posts as $post ){
|
|
echo '<li>';
|
|
setup_postdata($post);
|
|
$post_link = get_permalink();
|
|
$post_tags = get_the_tags();
|
|
$post_title = get_the_title();
|
|
$post_thumb = get_the_post_thumbnail( $post->ID, 'full');
|
|
$post_views = do_shortcode('[epvc_views]');
|
|
echo ' <a href=" ' . $post_link . ' "> ';
|
|
echo'
|
|
<div class="slider-img__container">
|
|
' . $post_thumb . '
|
|
</div>
|
|
';
|
|
echo '<div class="slider-details">';
|
|
if (!empty($post_tags)) {
|
|
echo '<div class="article-card-tags">';
|
|
foreach ($post_tags as $tag) {
|
|
echo '<span class="article-card-tag ' . $tag->slug . '__tag"># '. $tag->name .' </span>';
|
|
}
|
|
echo '</div>';
|
|
}
|
|
echo '<p class="slider-header">'. $post_title .'</p>';
|
|
echo '
|
|
<div class="article-card-details">
|
|
<div class="readingnow-post_avatar">
|
|
<img src="' . get_avatar_url(get_the_author_meta('ID')) . '" alt="">
|
|
</div>
|
|
<div class="article-card-author">' . get_the_author($post) . '</div>
|
|
<div class="article-card-date">' . get_the_date('d.m.Y', $post) . '</div>
|
|
<div class="spacer"></div> '. $post_views . '
|
|
</div>';
|
|
echo '</div>';
|
|
echo '</a>';
|
|
echo '</li>';
|
|
}
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
echo '
|
|
<a id="nextSlide">
|
|
<span class="arrow arrow-big"></span>
|
|
</a>
|
|
';
|
|
wp_reset_postdata();
|
|
echo('</div>');
|
|
echo('</div>');
|
|
}
|
|
?><?php
|
|
$featured_posts = get_field('article', 'option');
|
|
|
|
if( $featured_posts ){
|
|
echo '
|
|
<div class="slider__container">
|
|
<div class="container">
|
|
<a id="prevSlide">
|
|
<span class="arrow arrow-left arrow-big"></span>
|
|
</a>
|
|
<div class="trust-slider-container">';
|
|
echo '<ul id="index-trust-slider" class="slider index-trust-slider">';
|
|
foreach( $featured_posts as $post ){
|
|
echo '<li>';
|
|
setup_postdata($post);
|
|
$post_link = get_permalink();
|
|
$post_tags = get_the_tags();
|
|
$post_title = get_the_title();
|
|
$post_thumb = get_the_post_thumbnail( $post->ID, 'full');
|
|
$post_views = do_shortcode('[epvc_views]');
|
|
echo ' <a href=" ' . $post_link . ' "> ';
|
|
echo'
|
|
<div class="slider-img__container">
|
|
' . $post_thumb . '
|
|
</div>
|
|
';
|
|
echo '<div class="slider-details">';
|
|
if (!empty($post_tags)) {
|
|
echo '<div class="article-card-tags">';
|
|
foreach ($post_tags as $tag) {
|
|
echo '<span class="article-card-tag ' . $tag->slug . '__tag"># '. $tag->name .' </span>';
|
|
}
|
|
echo '</div>';
|
|
}
|
|
echo '<p class="slider-header">'. $post_title .'</p>';
|
|
echo '
|
|
<div class="article-card-details">
|
|
<div class="readingnow-post_avatar">
|
|
<img src="' . get_avatar_url(get_the_author_meta('ID')) . '" alt="">
|
|
</div>
|
|
<div class="article-card-author">' . get_the_author($post) . '</div>
|
|
<div class="article-card-date">' . get_the_date('d.m.Y', $post) . '</div>
|
|
<div class="spacer"></div> '. $post_views . '
|
|
</div>';
|
|
echo '</div>';
|
|
echo '</a>';
|
|
echo '</li>';
|
|
}
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
echo '
|
|
<a id="nextSlide">
|
|
<span class="arrow arrow-big"></span>
|
|
</a>
|
|
';
|
|
wp_reset_postdata();
|
|
echo('</div>');
|
|
echo('</div>');
|
|
}
|
|
?>
|
|
|
|
<?php
|
|
get_footer();
|
|
?>
|