Created
September 14, 2016 22:52
-
-
Save lots0logs/8af0cd6f6c4d692c9284b415d4869aff to your computer and use it in GitHub Desktop.
WordPress :: Divi Builder :: Fullwidth Portfolio Module :: Custom Thumbnail Size
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* DON'T copy the first line (above) if your functions.php already has it. | |
* ---------------------------------------------------------------------- */ | |
function my_et_theme_image_sizes( $sizes ) { | |
$sizes['200x200'] = 'my-et-pb-portfolio-image'; | |
return $sizes; | |
} | |
add_filter( 'et_theme_image_sizes', 'my_et_theme_image_sizes' ); | |
function my_et_fullwidth_portfolio_thumbnail_sizes( $size ) { | |
return 200; | |
} | |
add_action( 'et_pb_portfolio_image_width', 'my_et_fullwidth_portfolio_thumbnail_sizes' ); | |
add_action( 'et_pb_portfolio_image_width', 'my_et_fullwidth_portfolio_thumbnail_sizes' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
NOTE:
You must regenerate your thumbnails after adding the above code to your child theme. The following plugin is the best tool for the job: https://wordpress.org/plugins/force-regenerate-thumbnails/