WordPress: aggiungere un link al post nel riassunto

Possiamo aggiungere un link al resto del post anche nel contenuto del riassunto dello stesso. Vediamo come.

Aggiungete il seguente codice al file functions.php:


function excerpt_readmore($more) {
        return '... <a href="'. get_permalink($post->ID) . '" class="readmore">' . 'Leggi tutto' . '</a>';
}
add_filter('excerpt_more', 'excerpt_readmore');
Torna su