How to change post thumbnail to other image?

Use the iworks_upprev_get_the_post_thumbnail filter:

<?php
add_filter( 'iworks_upprev_get_the_post_thumbnail' , 'change_thumbnail' );
function change_thumbnail( $image )
{
    return '<img src="image.png" alt="" />';
}

Read more: Filter Reference / iworks upprev get the post thumbnail

Where to put this code?

There are three ways:

  1. made a one-file-plugin and put file into wp-content/plugins, then turn it on
  2. made a one-file-plugin and put file into wp-content/mu-plugins
  3. put this code into functions.php in current theme

I recommend using option 1 or 2, but 3 is the easiest.

Leave a Reply

Your email address will not be published. Required fields are marked *