Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save phirebase/ee48207be8703583c0a57e64bb56c494 to your computer and use it in GitHub Desktop.
Save phirebase/ee48207be8703583c0a57e64bb56c494 to your computer and use it in GitHub Desktop.
.blog-page .et_pb_post a img, body.archive .et_pb_post a img {
float: left;
margin-top: 0.6em;
margin-right: 1.2em;
border: solid 1px #ccc;
padding: 3px;
}
<?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