<?php
/**
 * The template for displaying Breaking News Post
 *
 * @link https://developer.wordpress.org/themes/basics/template-hierarchy/#single-post
 *
 * @package benqu
 */

$benqu_site_header = benqu_site_header();
$breaking_arg = array(
	'post_type' => 'post', 
	'posts_per_page' => 4, 
	'orderby' => 'date', 
	'order' => 'DESC', 
	'post_status' => 'publish', 
	'ignore_sticky_posts' => 1
);

$breaking_news_post = new WP_Query($breaking_arg);
if ($breaking_news_post->have_posts()) {
?>

<div class="pfy-breakingnews">
	<ul class="breaking-headline-active owl-carousel">	
	<?php
    while ($breaking_news_post->have_posts()):
        $breaking_news_post->the_post();

				if( 'header-style-five' === $benqu_site_header || 'header-style-six' === $benqu_site_header ) {
					$title = wp_trim_words( get_the_title(), 16, '...' );
				} else {
					$title = wp_trim_words( get_the_title(), 8, '...' );
				}
		?>
			<li><a href="<?php echo esc_url(get_permalink()); ?>"><?php echo esc_html($title); ?></a></li>
	<?php
	endwhile;
	wp_reset_postdata(); ?>
    </ul>
</div>

<?php }
