visualizzare didascalia immagine in evidenza/how to see the caption on the featured image
-
Salve, sto da giorni perdendo la testa dietro a una cosa apparentemente banale. Non riesco a far si che la didascalia dell’immagine venga visualizzata sulle immagini in evidenza degli articoli. Uso WP 4.7.3 con Newser Theme. Ho aggiunto il codice
if ( ! function_exists( ‘the_post_thumbnail_caption’ ) ) {
function the_post_thumbnail_caption() {
global $post;
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array(‘p’ => $thumbnail_id, ‘post_type’ => ‘attachment’));
if ($thumbnail_image && isset($thumbnail_image[0])) {
return ‘‘.$thumbnail_image[0]->post_excerpt.’‘;
} else {
return;
}
}
}nel file functions.php del tema child, senza successo. Qualcuno sa come aiutarmi? Grazie in anticipo.
_____________________________________________________________
Hi’, I’m trying to make the caption visible in the featured images and it’s days i’m working on it with no result. I use WP 4.7.3 with Newser Theme. I tried to paste the codeif ( ! function_exists( ‘the_post_thumbnail_caption’ ) ) {
function the_post_thumbnail_caption() {
global $post;
$thumbnail_id = get_post_thumbnail_id($post->ID);
$thumbnail_image = get_posts(array(‘p’ => $thumbnail_id, ‘post_type’ => ‘attachment’));
if ($thumbnail_image && isset($thumbnail_image[0])) {
return ‘‘.$thumbnail_image[0]->post_excerpt.’‘;
} else {
return;
}
}
}inside the functions.php file of the child theme and had no effect. Anyone can help? Thanks in advance
Ho bisogno d'aiuto per il blog (visibile solo agli utenti che hanno effettuato l'accesso).
-
Chiedo scusa, era una richiesta per wp.org e non .com ma non so come eliminare la discussione. Grazie comunque.
- L'argomento ‘visualizzare didascalia immagine in evidenza/how to see the caption on the featured image’ è chiuso a nuove risposte.