Skip to content

Instantly share code, notes, and snippets.

@kopepasah
Last active October 10, 2018 01:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kopepasah/97e16220ebf0a398a396 to your computer and use it in GitHub Desktop.
Save kopepasah/97e16220ebf0a398a396 to your computer and use it in GitHub Desktop.
Change Jetpack's Related Posts Thumbnail Size

Change Jetpack's Related Posts Thumbnail Size

Full tutorial can be found on kopepasah.com.

License

GNU General Public License v2 or later.

This code is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

Learn, use, share and enjoy!

<?php
/**
* Filter Jetpack's Related Post thumbnail size.
*
* @param $size (array) - Current width and height of thumbnail.
* @return $size (array) - New width and height of thumbnail.
*/
function custom_jetpack_relatedposts_filter_thumbnail_size( $size ) {
$size = array(
'width' => 600,
'height' => 450
);
return $size;
}
add_filter( 'jetpack_relatedposts_filter_thumbnail_size', 'custom_jetpack_relatedposts_filter_thumbnail_size' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment