Skip to content

Instantly share code, notes, and snippets.

View vietlongn's full-sized avatar
💭
hmm..

vietlongn

💭
hmm..
View GitHub Profile
@vietlongn
vietlongn / functions.php
Last active January 3, 2020 06:10
Custom OG image WP
define( 'FB_COVER_SIZE_NAME', 'fb-cover' );
function custom_theme_setup() {
add_image_size( FB_COVER_SIZE_NAME, 660, 347, true );
// more img sizes
}
add_action( 'init', 'custom_theme_setup' );
function lb_image_downsize( $value = false, $post_id, $size = 'medium' )
{
$arr_size = get_image_size($size);