Jun 25 2009

Wordpress e re-reloaded excerptRe-reloaded excerpt for Wordpress

Posted by Francesco in Howto, Internet

Ecco il punto: volevo che wordpress mi mostrasse solo un breve estratto degli articoli.
Per fare questo non è necessaria chissa quale abilità, wordpress integra già questa funzione: basta andare in Aspetto>Editor>index.php, sostituire the_content() con the_excerpt() e salvare.

Il problema è che per leggere l’articolo intero bisogna cliccare sul titolo, niente di male, ma a me piace il link more.

De gustibus non disputandum est.

Per porre rimedio a questo “problema” ho installato il plugin re-reloaded excerpt con la solita procedura.

Per abilitarlo bisogna sostituire a the_content una delle seguenti stringhe:

<?php the_excerpt_rereloaded(); ?>
//mostra l'estratto standard

<?php the_excerpt_rereloaded('80','More','<strong><em>','div'); ?>
//estratto di 80 parole, con link "more", accetta i tag strong ed em
//il link "more" è <div><p><a href="#etc">More</a></p></div>

<?php the_excerpt_rereloaded('80','More','all','plain'); ?>
//estratto di 80 parole,link "more", tutti i tag sono accettati
//il link "more" è incluso nell'estratto senza contenitori addizionali

Dopodiché salvate ed ecco il vostro blog popolarsi di estratti!I wanted to show an excerpt of my posts.
Wordpress has a built-in excerpt feature. To enable it you’ve to edit your index.php (wp-admin>Appearance>Editor) changing the_content() in the_excerpt.
But this doesn’t show the “more” link: to view the full post you’ve to clic on its title.
But I want the link “more”.
Google-ing a little bit, i found re-reloaded excerpt.

Hot to use it?

Install it as any other wp plugin and then replace the_content with one of the following strings:

<?php the_excerpt_rereloaded(); ?>
//display the excerpt with default settings.

<?php the_excerpt_rereloaded('80','More','<strong><em>','div'); ?>
//display an excerpt of 80 words
//the link to full post is simply "more"
//allowed tags are strong and em
//the link path is <div><p><a href="#etc">More</a></p></div>

<?php the_excerpt_rereloaded('80','More','all','plain'); ?>
//display an excerpt of 80 words
//the link to full post is simply "more"
//all tags are accepted
//the link path is included in the excerpt paragraph with no additional container

Now just save your changes.
Congratulations: mission completed!