I'm trying to modify the thumbnail sizes in a related posts plugin using a filter.

This is the code for applying the filter which is in the plugin file for displaying the front end output:

$thumb_size = apply_filters( 'bawmrp_thumb_size', array( 100, 100 ) );.

I tried placing the following code in my functions.php file but it's not working:

add_filter( 'bawmrp_thumb_size', 'related_posts_custom_thumbnail_size' );

function related_posts_custom_thumbnail_size () {
$custom_thumb_size = array( 200, 100 );
return $custom_thumb_size;
  • Where are you putting this piece of code? Where is apply_filters( 'bawmrp_thumb_size', array( 100, 100 ) ) located? Also, it seems to me you are trying to change a registered image size, right? So after changing it did you perform an upload in order to see if it's really not working? Mar 1, 2017 at 11:51
  • Hi, I've updated the question to include the information you asked about.
    – jrcollins
    Mar 1, 2017 at 21:02


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.