Skip to content

Instantly share code, notes, and snippets.

@lucasprogamer
Last active June 15, 2022 20:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lucasprogamer/3f09fc94c4019803322896eefec21ccb to your computer and use it in GitHub Desktop.
Save lucasprogamer/3f09fc94c4019803322896eefec21ccb to your computer and use it in GitHub Desktop.
this gist is to improve wp featured image and set description
<?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