Skip to content

Instantly share code, notes, and snippets.

@noballgames
Last active June 26, 2017 16:08
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 noballgames/eab5bd30749024259bfd2a1a44414f8d to your computer and use it in GitHub Desktop.
Save noballgames/eab5bd30749024259bfd2a1a44414f8d to your computer and use it in GitHub Desktop.
In: themes/divi-child/functions.php
<?php
add_action( 'wp_enqueue_scripts', 'my_enqueue_assets' );
function my_enqueue_assets() {
wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
}
function mycustom_featured_width() { return 320;} /* Custom featured post image width */
add_filter( 'et_pb_blog_image_width', 'mycustom_featured_width');
function mycustom_featured_height() { return auto;} /* Custom featured post image height */
add_filter( 'et_pb_blog_image_height', 'mycustom_featured_height');
function mycustom_featured_size( $image_sizes ) {
$custom_size = mycustom_featured_width() . 'x' . mycustom_featured_height();
$image_sizes[$custom_size] = 'et-pb-post-main-image-thumbnail';
return $image_sizes;
}
add_filter( 'et_theme_image_sizes', 'mycustom_featured_size' );
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment