Skip to content

Instantly share code, notes, and snippets.

@lots0logs
Created September 14, 2016 22:52
Show Gist options
  • Save lots0logs/8af0cd6f6c4d692c9284b415d4869aff to your computer and use it in GitHub Desktop.
Save lots0logs/8af0cd6f6c4d692c9284b415d4869aff to your computer and use it in GitHub Desktop.
WordPress :: Divi Builder :: Fullwidth Portfolio Module :: Custom Thumbnail Size
<?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' );
@lots0logs
Copy link
Author

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/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment