Last active
August 14, 2016 22:31
-
-
Save TomFrearson/23e42899c936656fd9bb to your computer and use it in GitHub Desktop.
This file contains hidden or 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 | |
/** | |
* Set blog, index, archive & post thumbnail sizes | |
*/ | |
/* Blog */ | |
function wpt_blog_thumbnail_width( $width ) { | |
return 150; //blog thumbnail width in pixels | |
} | |
add_filter( 'et_pb_blog_image_width', 'wpt_blog_thumbnail_width'); | |
function wpt_blog_thumbnail_height( $height ) { | |
return 150; //blog thumbnail height in pixels | |
} | |
add_filter( 'et_pb_blog_image_height', 'wpt_blog_thumbnail_height'); | |
/* Index & archive */ | |
function wpt_index_thumbnail_width( $width ) { | |
if( !is_single() ) { | |
return 150; //index thumbnail width in pixels | |
} else { | |
return $width; | |
} | |
} | |
add_filter( 'et_pb_index_blog_image_width', 'wpt_index_thumbnail_width'); | |
function wpt_index_thumbnail_height( $height ) { | |
if( !is_single() ) { | |
return 150; //index thumbnail height in pixels | |
} else { | |
return $height; | |
} | |
} | |
add_filter( 'et_pb_index_blog_image_height', 'wpt_index_thumbnail_height'); | |
/* Post */ | |
function wpt_post_thumbnail_width( $width ) { | |
if( is_single() ) { | |
return 300; //post thumbnail width in pixels | |
} else { | |
return $width; | |
} | |
} | |
add_filter( 'et_pb_index_blog_image_width', 'wpt_post_thumbnail_width'); | |
function wpt_post_thumbnail_height( $height ) { | |
if( is_single() ) { | |
return 300; //post thumbnail height in pixels | |
} else { | |
return $height; | |
} | |
} | |
add_filter( 'et_pb_index_blog_image_height', 'wpt_post_thumbnail_height'); | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment