Featured another news in wordpress

To feature another news in WordPress, you can use the following methods:

Method 1: Using the Featured Image

  1. Go to the post or page you want to feature.
  2. Click on the "Set featured image" button.
  3. Upload a new image or select an existing one from your media library.
  4. Click "Set featured image" to save the changes.

Method 2: Using the Featured Post Widget

  1. Install and activate a featured post widget plugin, such as "Featured Posts" or "WP Featured Posts".
  2. Go to the widget area of your WordPress dashboard.
  3. Drag and drop the featured post widget to the desired location.
  4. Configure the widget settings, such as the number of posts to display and the categories to include.
  5. Click "Save" to save the changes.

Method 3: Using a Custom Code

  1. Add the following code to your theme's functions.php file:
    function featured_news() {
     $args = array(
         'post_type' => 'post',
         'posts_per_page' => 1,
         'meta_key' => '_thumbnail_id',
         'meta_value' => get_post_thumbnail_id(get_the_ID())
     );
     $featured_post = new WP_Query($args);
     if ($featured_post->have_posts()) {
         while ($featured_post->have_posts()) {
             $featured_post->the_post();
            ?>
             <h2><?php the_title();?></h2>
             <p><?php the_excerpt();?></p>
             <?php
         }
     }
     wp_reset_postdata();
    }
  2. Add the following code to your theme's template file (e.g. index.php):
    <?php featured_news();?>

    This code will display the featured news post at the top of your page.

Method 4: Using a Plugin

  1. Install and activate a plugin, such as "News Carousel" or "Featured Posts Slider".
  2. Configure the plugin settings, such as the number of posts to display and the categories to include.
  3. Add the plugin's shortcode to your page or post:
    [featured-posts]

    This will display the featured news post in a carousel or slider format.

Note: The above methods may require some customization to fit your specific needs. You may need to modify the code or plugin settings to achieve the desired result.