Change the default excerpt ending in WordPress

By default, WordPress ends excerpts with “[…]” and some people do not like how that looks. So, here is how to change it to “…” or something of your own choice.

Add this to your theme’s functions.php and you are done:

/*  Excerpt ending
/* ------------------------------------ */
function alx_excerpt_more( $more ) {
	return '...';
}
add_filter( 'excerpt_more', 'alx_excerpt_more' );

I use & #46; instead of period signs because some web browsers tend to convert 3 period signs into something custom that may cause issues.

Change the quality of your WordPress thumbnails

Do you think that your cropped thumbnails don’t have a good enough quality? By default, the jpeg quality is set to 90 out of 100 in WordPress – a good balance between performance and looks. Here is how to increase it to max quality, or close to it, depending on what you want.

Add this to your theme’s functions.php:

/*  Custom thumbnail quality
/* ------------------------------------ */
function alx_thumbnail_quality( $quality ) {
	return 100;
}
add_filter( 'jpeg_quality', 'alx_thumbnail_quality' );
add_filter( 'wp_editor_set_quality', 'alx_thumbnail_quality' );

Change 100 to anything you want. 95 would be the step inbetween default quality and max quality.

This code also works with images being resized via the new WP_Image_Editor class that was released with WordPress 3.5.