Reply To: Breaking news Date

NapitWPTech Theme Support Forums The NewsMag Breaking news Date Reply To: Breaking news Date


Bishal Napit


For displaying the excerpt instead of date in the breaking news section provided via this theme, is going to create design issue and will not look good in the visitors eye. However, if you are ok with that, then, you can try the below PHP code in the functions.php file of the child theme and check:-

function the_newsmag_breaking_news() {
	$get_featured_posts = new WP_Query(array(
		'posts_per_page' => 10,
		'post_type' => 'post',
		'ignore_sticky_posts' => true
	<ul class="latest-news">
		<?php while ($get_featured_posts->have_posts()):$get_featured_posts->the_post(); ?>
			<li class="latest-news-lists">
				<a href="<?php the_permalink(); ?>" title="<?php the_title_attribute(); ?>">

					<?php if (has_post_thumbnail()) : ?>
						<figure class="featured-image">
							<?php the_post_thumbnail('the-newsmag-featured-small-thumbnail'); ?>
					<?php endif; ?>
					<span class="entry-title"><?php the_title(); ?></span>
					<?php the_excerpt(); ?>
		<?php endwhile; ?>
	// Reset Post Data

You can find the tutorial on creating the WordPress child theme as well as this theme’s sample child theme via this link:

Bishal Napit