How to automatically produce featured images to posts (5 posts)

  1. borbou
    Posted 3 years ago #

    Hello there!

    My problem is this: I have some of my friends to post in my sports-blog. They dont go well with the technology and most of the times they forget (or are lazy) to add an image to their post.

    My question is: is there any way or a plugin that will attach random images from a certain folder (that i will have previously upload) to a post that has no image?

    Any help would me much appreciated!

  2. racer x
    Posted 3 years ago #

    I agree that there needs to be a fallback when people forget to designate a featured image. If this were my theme, I'd have put a fall-back to catch the first image attached to the post.

    Anyhow, maybe you can try this plugin.

    It is coded by a wordpress master well received by the community as a top level wordpress developer.

  3. michael.mariart
    Posted 3 years ago #

    This isn't something that I'd get a plugin to do. I'd want this set up in my theme, because that's where the image is going, and that's what knows what size the image needs to be.

    It's easy to do in the template pages. As a bit of an example...

    if (has_post_thumbnail ()) {
        the_post_thumbnail ("my_size");
    else {
       echo "<img src="path/to/default/image.jpg" />";
  4. racer x
    Posted 3 years ago #

    I agree, if it were "my" theme, I'd have a fall-back in place as well. However, I am assuming borbou wants an easier solution for both his implementing and his editors. Keep in mind, what you are suggesting is that; if a featured image is not found, use one(and only one) default image. If using the plugin, it will find better alternate solutions that will result in a better outcome.

  5. borbou
    Posted 3 years ago #

    Thank you all for your replies!

    Racer x has totally got the point!

    I want to have a folder filled with images (let's say 50) and when there is no image to randomly pick one of those..

    It would also be wise to have different folders for different categories.

    I will try the plugin recommended by racer and see how it works.

    To be honest I would be sure that there existed a plugin to automatically do all this stuff!


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.