Breaking news Date

NapitWPTech Theme Support Forums The NewsMag Breaking news Date

This topic contains 3 replies, has 2 voices, and was last updated by  Bishal Napit 2 months, 2 weeks ago.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #200

    webauthor
    Participant

    Hi, Bishal, again a little issue:
    Is it possible to show only the Topic and the Picture in the breaking news, without date?
    Best thanks,
    Jürgen

    #201

    Bishal Napit
    Keymaster

    @webauthor

    Can you paste the below provided CSS code in the Additional CSS Box provided via the Customizer Options and check:-

    .latest-news-lists .entry-date {
    	display: none;
    }

    Thanks.
    Bishal Napit

    #203

    webauthor
    Participant

    thanks, it works. Can I display an excerpt instead?
    Thanks,
    Jürgen

    #204

    Bishal Napit
    Keymaster

    @webauthor

    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'); ?>
    						</figure>
    					<?php endif; ?>
    					<span class="entry-title"><?php the_title(); ?></span>
    					<?php the_excerpt(); ?>
    				</a>
    			</li>
    		<?php endwhile; ?>
    	</ul>
    	<?php
    	// Reset Post Data
    	wp_reset_query();
    }

    You can find the tutorial on creating the WordPress child theme as well as this theme’s sample child theme via this link: https://napitwptech.com/tutorial/wordpress-development/tutorial-creating-wordpress-child-theme/.

    Thanks.
    Bishal Napit

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.