-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnews-ticker.php
39 lines (36 loc) · 1.15 KB
/
news-ticker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
<?php
/**
* Template part for displaying the news ticker
*
* @link https://codex.wordpress.org/Template_Hierarchy
*
* @package Newspaper X
*/
$args = array(
'numberposts' => 10,
'orderby' => 'date',
'order' => 'DESC',
'post_type' => 'post',
'post_status' => 'publish',
);
$frontpage_header = new WP_Query( $args );
wp_reset_postdata();
if ( $frontpage_header->have_posts() ): $i = 0; ?>
<!-- News Ticker Module -->
<section class="newspaper-x-news-ticker">
<span class="newspaper-x-module-title">
<span class="fa-stack fa-lg">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-bullhorn fa-stack-1x fa-inverse"></i>
</span>
<?php echo esc_html__( 'Latest News', 'newspaper-x' ) ?>
</span>
<ul class="newspaper-x-news-carousel owl-carousel owl-theme">
<?php while ( $frontpage_header->have_posts() ) : $frontpage_header->the_post(); ?>
<li class="item">
<a href="<?php echo esc_url( get_permalink( get_the_id() ) ) ?>"><?php echo esc_html( get_the_title() ) ?></a>
</li>
<?php endwhile; ?>
</ul>
</section>
<?php endif; ?>