<?php
// https://wordpress.org/themes/royale-news/

if ( ! defined( 'ABSPATH' ) ) {
    exit; // Exit if accessed directly.
}
?>

    <?php
    $theme_options = pmthemes_theme_options();
    $ticker_title = $theme_options['ticker_news_title'];
    $ticker_args = array(
        'posts_per_page'	=> $theme_options['ticker_news_count'],
        'cat'				=> $theme_options['ticker_news_category'],
        'post_type'			=> 'post',
        'post_status'		=> 'publish'
    );
    $ticker_query = new WP_Query( $ticker_args );
    if( $ticker_query->have_posts() ) :
        ?>
        <div class="simple-ticker" id="js-ticker-fade">
            <?php
            if( !empty( $ticker_title ) ) :
                ?>
            <ul>
                        <li>
                            <?php
                            echo esc_html( $ticker_title );
                            ?>
                        </li>
            </ul>
            <?php
            endif;
            ?>


                        <?php
                        while( $ticker_query->have_posts() ) :
                            $ticker_query->the_post();
                            ?>
                            <ul>
                                <li>
                                    <a href="<?php the_permalink();?>">
                                        <?php the_title(); ?>
                                    </a>
                                </li><!-- .ticker-news -->
                            </ul><!-- .item -->
                        <?php
                        endwhile;
                        wp_reset_postdata();
                        ?>
        </div>

    <?php
    endif;
    ?>