WordPress: aggiungere un link al post nel riassunto

Come aggiungere un link al resto del post nei riassunti di WordPress.

WordPress di Gabriele Romanato

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');

Commenti