HEX
Server: Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System: Linux box12.multicloud.host 4.18.0-553.52.1.el8_10.x86_64 #1 SMP Wed May 14 09:36:12 EDT 2025 x86_64
User: kashmira (1008)
PHP: 8.1.32
Disabled: NONE
Upload Files
File: /home/kashmira/public_html/razitahir.com/wp-content/themes/upress/template-parts/news-ticker.php
<?php
$post_type = get_theme_mod('nwsticker_post_setting', 'post');
if($post_type == 'video'){
    $category = intval(get_theme_mod('newsticket_video_cat_settings', 0));
} else {
    $category = intval(get_theme_mod('newsticket_cat_settings', 1));
}
$limit = intval(get_theme_mod('nwstickerlimitpost_setting', 5));
?>
<div class="breaking_head hidden-xs">
    <span id="newsArrows" class="arrows animated infinite flash"></span> <?php echo get_theme_mod('newstickerlable_setting','اہم خبریں') ?>
</div>
<div class="breaking_body hidden-xs" id="breakingNews">
    <ul>
        <?php
            // The Query
            if($post_type == 'video'){
                $ticker_query = new WP_Query( 
                    array (
                        'post_type' => 'video',
                        'posts_per_page' => $limit,
                        'tax_query' => array(
                            array(
                            'taxonomy' => 'video_category',
                            'field' => 'term_id',
                            'terms' => $category,
                            ),
                        ),
                    )
                );
            } else {
                $ticker_query = new WP_Query( 
                    array (
                        'post_type' => 'post',
                        'posts_per_page' => $limit,
                        'cat'   => $category,
                    )
                );
            }
            

            // The Loop
            if ( $ticker_query->have_posts() ) {
                while ( $ticker_query->have_posts() ) {
                    $ticker_query->the_post();
                    echo '<li><a href="'. get_the_permalink() .'">' . get_the_title() . '</a></li>';
                }
            } else {
                // no posts found
            }
            /* Restore original Post Data */
            wp_reset_postdata();
        ?>
    </ul>
</div>