function rayat_breaking_news_ticker(){ob_start();?><div class="breaking-container"><div class="live-label">🔴 LIVE</div><div class="breaking-news"><?php $args=array('category_name'=>'breaking-news','posts_per_page'=>8);$query=new WP_Query($args);if($query->have_posts()) :while($query->have_posts()) :$query->the_post();?>🔴 <a href="<?php the_permalink(); ?>"><?php the_title();?></a>&nbsp;&nbsp;&nbsp;<?php endwhile;wp_reset_postdata();else:?>No breaking news available <?php endif;?></div></div><style>.breaking-container{display:flex;align-items:center;background:#000;overflow:hidden;height:45px;position:relative;z-index:999}.live-label{background:red;color:#fff;padding:0 15px;display:flex;align-items:center;animation:blink 1s infinite}@keyframes blink{50%{opacity:.5}}.breaking-news{color:#fff;white-space:nowrap;display:inline-block;padding-left:100%;animation:scrollNews 25s linear infinite}.breaking-news a{color:#fff;text-decoration:none}.breaking-news a:hover{color:#ff0}@keyframes scrollNews{0%{transform:translateX(0)}100%{transform:translateX(-100%)}}@media(max-width:768px){.breaking-container{height:35px}.live-label{font-size:12px}}</style><?php return ob_get_clean();}add_shortcode('rayat_ticker','rayat_breaking_news_ticker');