Jump to content

  • Free consultations and support
  • Live chatClick Here for Live Chat
  • Call ico 1888-906-1888
    Phone support: Open

    Ready for your call :)

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams

    Phone support: Closed

    We are back in: 1h 20m

    Our business hours:

    Mon — Fri, 2am — 8pm (EST)

    US & EU support teams


How to make the Featured Image Required for WordPress Posts?

featured image required wordpress

  • Please log in to reply
&nsbp;

#1 OneDes

OneDes

    Senior Member

  • Designer
  • 282 posts

Posted 18 November 2013 - 10:48 PM

If you run a WordPress site with multi author. To remind your authors to always upload a featured image every time they submit a WordPress post, you should install the plugin Require Featured Image and then activate it. You do not need to change any settings, as soon as this plugin is activated, a notification box will display in your post edit screen, telling the user that the post need a featured image. You won’t be able to publish your post unless you add a featured image.

#2 alexmorco

alexmorco

    Junior Member

  • Designer
  • 3 posts

Posted 13 February 2019 - 11:06 AM

Setting up featured image helps to show visitor about the page and products, I was trying to set WordPress featured image in my blog it helped to increase my bounce rate and visitors clicked on featured image to go to the post.



#3 alexmorco

alexmorco

    Junior Member

  • Designer
  • 3 posts

Posted 13 February 2019 - 11:06 AM

Setting up featured image helps to show visitor about the page and products, I was trying to set WordPress featured image in my blog it helped to increase my bounce rate and visitors clicked on featured image to go to the post.



#4 bogdan_patriche89

bogdan_patriche89

    Junior Member

  • Designer
  • 1 posts

Posted 03 December 2019 - 08:45 AM

Hello everyone, so far I can't find a single step-by-step guide in how to do this. I think that, Kallyas theme developed by Hogash fix this issue.



#5 alexcray

alexcray

    Member

  • Designer
  • 73 posts

Posted Today, 03:46 AM

If you run a WordPress site with multi author. To remind your authors to always upload a featured image every time they submit a WordPress post, you should install the plugin Require Featured Image and then activate it. You do not need to change any settings, as soon as this plugin is activated, a notification box will display in your post edit screen, telling the user that the post need a featured image. You won’t be able to publish your post unless you add a featured image.

To make the featured image required for WordPress posts, you can use a combination of custom code and validation techniques. Here's a step-by-step guide to achieve this:
 
Add Custom Code to Functions.php:
Open your theme's functions.php file, which is located in your theme's directory, and add the following code:
php
Copy code
function wpb_required_featured_image( $content, $post ) {
    if ( 'post' === $post->post_type && ! has_post_thumbnail( $post->ID ) ) {
        $content .= '<p style="color: red;">Please set a featured image for your post!</p>';
    }
    return $content;
}
add_action( 'admin_notices', 'wpb_required_featured_image', 10, 2 );
This code will display a notice in the post editor if a featured image is not set when a user tries to publish or update a post.
Customize Error Message (Optional):
You can customize the error message by modifying the text inside the <p> tag in the code above.
Testing:
Save the changes to functions.php and test the functionality by creating or editing a post in the WordPress admin dashboard. If you try to publish or update a post without setting a featured image, you should see the error message displayed.
By following these steps, you can enforce the requirement of having a featured image for WordPress posts. This ensures consistency and improves the visual appeal of your website by encouraging users to include relevant images with their posts.






Also tagged with one or more of these keywords: featured image required, wordpress

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users