kollapsminoriteten/wp-content/themes/xpomagazine/template-parts/partials/news-ticker/news-ticker-1.php

59 lines
2.1 KiB
PHP

<?php
$walkerpress_focus_news_status = esc_attr(get_theme_mod('focus_news_status'));
if($walkerpress_focus_news_status){?>
<div class="walkerwp-wraper ticker-news-wraper ticker-layout-1 no-gap">
<div class="walkerwp-container">
<div class="ticker-header walkerwp-grid-2">
<?php if(get_theme_mod('focus_news_ticker_heading')){
$walkemag_ticker_heading = get_theme_mod('focus_news_ticker_heading');
}else{
$walkemag_ticker_heading= __('Latest News','xpomagazine');
}?>
<div class="circle-animate">
<div class="flash"></div>
</div> <h4><?php echo esc_html($walkemag_ticker_heading);?>:</h4>
</div>
<div class="news-ticker-box walkerwp-grid-10 ">
<div class="tickerMarqueeOne">
<?php
$focus_post_type = get_theme_mod('focus_news_post_type');
if(get_theme_mod('focus_news_items_show')){
$focus_news_total= get_theme_mod('focus_news_items_show');
}else{
$focus_news_total =8;
}
$sticky = get_option( 'sticky_posts' );
$focus_post_cat = get_theme_mod('walkerpress_focus_news_category');
if($focus_post_type =='latest-post'){
$focus_args = array(
'post_type' => 'post',
'order'=> 'DESC',
'posts_per_page' => $focus_news_total,
'ignore_sticky_posts' => 1,
'post__not_in' => $sticky
);
}else{
$focus_args = array(
'post_type' => 'post',
'order'=> 'DESC',
'posts_per_page' => $focus_news_total,
'ignore_sticky_posts' => 1,
'post__not_in' => $sticky,
'category_name' => $focus_post_cat,
);
}
$walkerpress_focus_query = new WP_Query($focus_args);
while ($walkerpress_focus_query->have_posts()) : $walkerpress_focus_query->the_post();?>
<span class="focus-news-box">
<a href="<?php echo the_permalink();?>"><i class="fas fa-arrow-circle-right"></i> <?php the_title(); ?></a>
</span>
<?php endwhile;
wp_reset_postdata(); ?>
</div>
</div>
</div>
</div>
</div>
<?php } ?>