Last active
June 15, 2022 20:09
-
-
Save lucasprogamer/3f09fc94c4019803322896eefec21ccb to your computer and use it in GitHub Desktop.
this gist is to improve wp featured image and set description
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 | |
function new_post_thumbnail_meta_box() { | |
global $post; | |
echo '<p class="howto">Tamanho recomendado: 1413px × 640px </p>'; | |
$thumbnail_id = get_post_meta( $post->ID, '_thumbnail_id', true ); | |
echo _wp_post_thumbnail_html( $thumbnail_id ); | |
} | |
function render_new_post_thumbnail_meta_box() { | |
global $post_type; | |
// Antigo metabox | |
remove_meta_box( 'postimagediv','post','side' ); | |
// Novo | |
add_meta_box('postimagediv', __('Imagem Destaque'), 'new_post_thumbnail_meta_box', $post_type, 'side', 'low'); | |
} | |
add_action('do_meta_boxes', 'render_new_post_thumbnail_meta_box'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment