Skip to content

Instantly share code, notes, and snippets.

View ThemeMetric's full-sized avatar
🏠
Freelancer

Sajjad Hossain ThemeMetric

🏠
Freelancer
View GitHub Profile
@nuhil
nuhil / js.md
Last active July 1, 2024 20:45
Javascript Handbook
@bappi-d-great
bappi-d-great / How to create different thumb size for different post type.php
Last active November 18, 2017 23:45
How to create different thumb size for different post type
<?php
add_action( 'pre-upload-ui', 'get_the_post_type' );
function get_the_post_type() {
$post_type = isset( $_REQUEST['post_type'] ) ? $_REQUEST['post_type'] : 'post';
set_transient( 'attached_post_type', $post_type );
}
add_filter( 'intermediate_image_sizes_advanced', 'add_image_size_for_post_type', 10 );
function add_image_size_for_post_type( $sizes ) {