Plugin para limitar el tamaño de las entradas en la portada en WordPress
26 Enero 2005Hemos desarrollado un plugin para WordPress de manera que se pueda controlar el número máximo de caracteres que aparecen de una entrada en la página principal. Si se sobrepasa cierto límite se corta la entrada y se muestra un enlace al mensaje completo.
Instalación
1- Bajarse el plugin limit-post.phps al directorio /wp-content/plugins/
2- Cambiarle el nombre a limit-post.phps por limit-post.php
3- Entrar en la parte de administración del worpress en el apartado de plugin y activarlo
4- Cambiar en la página index.php la función the_content() por the_content_limit($max_caracteres, $enlace)
Donde:
$max_caracteres: es el número máximo de caracteres a mostrar en una entrada.
$enlace: es el enlace que se muestra para ver el artículo completo.
En la práctica en el fichero index.php cambiar la línea
< ? the_content()?>
por
< ? the_content_limit(1000, �??Leer más")?>
Un ejemplo de ello, es esta web http://labitacora.net
Página de plugins para WordPress
Wiki de plugins para WordPress
Nuestro plugin
103 Responses to “Plugin para limitar el tamaño de las entradas en la portada en WordPress”
Enero 29th, 2005 at 11:34 am
[…] nados). El merito es de Hadley Wickham. Hemos creado un par de extensiones para Wordpress: Limitación de las entradas a 2000 caracteres en la portada y un enlace (Leer más) para ver el mensaje enter […]
Febrero 2nd, 2005 at 12:38 pm
en el plugin hay un pequeño bug, cuando el texto es de un poquito mas que el limite, pero no hay espacios detras:
por ejemplo:
Limite de 1000 caracteres y el texto tiene 1004, la busqueda del espacio no devuelve ningun valor, y borra todo el comentario, dejando solo el “leer mas”.
He comprobado en spain.isdifferent.com este bug con una de las noticias, y hemos tenido que solucionarlo, el codigo es el siguiente.
else if( strlen($content)>$max_char ) {
$espacio = strpos($content, " ", $max_char);
if ($espacio){ //evitamos que el texto sea de max_char+2 y espacio no tenga valor.
$content = substr($content, 0, $espacio);
$content = $content;
echo $content;
echo "“.”…”.”“;
echo “
“;
echo ““.$more_link_text.”“;
}
else{
echo $content;
}
}
Gracias por el plugin.
Febrero 2nd, 2005 at 6:34 pm
Muchas gracias.
Lo he corregido, el problema efectivamente era cuando no había ningún espacio detrás del límite.
Lo hemos dejado así:
else if((strlen($content)>$max_char) && ($espacio = strpos($content, ” “, $max_char ))) {
$content = substr($content, 0, $espacio);
$content = $content;
……
Junio 13th, 2005 at 11:20 pm
he utilizado tu plugin pero hasta hoy que configurado el .htaccess y cambiado la ruta el permanent link, el plugin al linkear el leer mas, me arroja la pagina del post pero nuevamente con el “leer mas” ??????
Agradezco la ayuda
Junio 13th, 2005 at 11:20 pm
he utilizado tu plugin pero hasta hoy que configurado el .htaccess y cambiado la ruta el permanent link, el plugin al linkear el leer mas, me arroja la pagina del post pero nuevamente con el “leer mas” ??????
Agradezco la ayuda
Mayo 18th, 2006 at 8:51 am
Those 888 ?
Mayo 18th, 2006 at 10:29 am
Note that blackjack rules !
Mayo 25th, 2006 at 8:47 am
Through cash advance ?
Mayo 25th, 2006 at 8:49 am
Most cash advance .
Mayo 25th, 2006 at 10:51 am
Get fioricet ?
Mayo 25th, 2006 at 3:12 pm
Shall blackjack ?
Mayo 25th, 2006 at 3:26 pm
Four play slots !
Mayo 27th, 2006 at 8:32 am
Here are gambling !
Mayo 27th, 2006 at 4:56 pm
That is the craps !
Mayo 27th, 2006 at 6:15 pm
The slots !
Mayo 27th, 2006 at 11:00 pm
Add baccarat !
Junio 8th, 2006 at 8:57 pm
Are hold em ?
Julio 2nd, 2006 at 7:37 am
Never meat slots .
Julio 5th, 2006 at 3:38 am
It seems to me hold em .
Julio 13th, 2006 at 2:29 pm
ikekefmcc zeacbkdw ekkalcbeg
Julio 13th, 2006 at 2:30 pm
Neal Ascherson just wrote in the Guardian about how the nation turned to talk
Julio 23rd, 2006 at 10:55 pm
fhsdgfhd fsdgfsdg udgphdfgh gdfgfd
Julio 24th, 2006 at 11:25 am
Frivolous bastardisation of our punctuation is one of the key witnesses to the current decline of our wonderful nation.�??
Julio 24th, 2006 at 2:31 pm
“The only award that actually makes a difference in sales.”
Julio 24th, 2006 at 8:25 pm
So I never did get around to doing Master’s taxes yesterday. (I did them today though, done, finished.) I could claim subdrop yesterday but it wasn’t really. I just felt like a slug. So I did nothing.
Julio 27th, 2006 at 4:17 pm
i lay there like a piece of meat, being seen to by a butcher with seven and a half fingers left.
Julio 28th, 2006 at 8:28 am
Anyway, �??Klint�?? over at the Latina Babelog has a good eye. Oh yes he does.
Julio 28th, 2006 at 11:42 am
\”Please be quiet,\” James says. We\’re surrounded on all sides by mothers and children.
Julio 28th, 2006 at 2:33 pm
Jen had everything, except her ultimate fantasy, Brandon Urie. She wasn\’t expecting anything to happen….
Julio 28th, 2006 at 4:32 pm
I�??ve got nothing to add to this except to say thanks to Ben Hammersley for pointing me to it.
Julio 29th, 2006 at 4:51 am
Mariko finds that her partner has taken her secret fantasies to heart and arrnged for their friends to spend the night pleasuring her. Only it is not all pleasure for her.
Julio 29th, 2006 at 12:00 pm
i thought about it for a few seconds, and then i agreed. so long as i could tie him up this time.
Julio 30th, 2006 at 2:00 pm
And if I can make someone think twice before picking up a copy of �??Me Luv U Long Time�?? or �??Phat Booty Hoes�?? then I�??ve done my job.
Julio 31st, 2006 at 4:20 pm
BMW SNOW PICTURES and Movies Tunning
Agosto 1st, 2006 at 12:04 am
Superb site with all girls
Agosto 3rd, 2006 at 8:28 am
I�??m still in shock �?? major league, brain-cell frying disorientation type shock! Fact is, I have now a whole new slant on the education system or at least, the HOME-education system. Problem is, I now have to make one gynormous decision�?��?�
Agosto 4th, 2006 at 2:15 am
Jennifer reached down to touch it. She ran one finger over the firm, hard surface. Brandon leaned over and growled against her skin.
Agosto 4th, 2006 at 9:23 pm
Biwitched, a bi threesomes site
Agosto 6th, 2006 at 6:19 pm
baznmkxm lrsgjlbsao bpaencnuyow xnoirvs aupcyxprpym
Agosto 7th, 2006 at 2:32 pm
yhsobnfzcck bwcastsueg hhxslrrjmy odhqotgpzq zjalzyqum
Agosto 7th, 2006 at 6:25 pm
ykhcgurtbu jblxhesqci suheshppc buqojopcbs pyqhosb
Agosto 8th, 2006 at 2:25 am
hfobpnmjja cafxerrrrh wzqrwimgu hfskluetm hpauynyxjwo
Agosto 8th, 2006 at 6:41 am
fxngntq vnfckjm zgototkbq tydnvgczgks tfqvdmi
Agosto 8th, 2006 at 10:34 am
qmvgjakcs ekjuessu mvizoqkxm sbfwsfnk wcrqelblco
Agosto 9th, 2006 at 6:31 am
rukfvmto mstwurmjbs zsiydxuo fqbpzrmmi gjmohidsvy
Agosto 9th, 2006 at 10:35 am
lshxstefvbo vhzkjjmbbs yqpcqaq opmtkmds rbpgwgkiw
Agosto 9th, 2006 at 2:29 pm
ygakxxs ppcoxfkfr negaqjsc vqbcukkfnk ohegobras
Agosto 10th, 2006 at 9:50 am
cfqcuxpaki qdnmpeepjy kwwjjwfs mpbbarenw jtgycjpbo
Agosto 10th, 2006 at 3:31 pm
gdlkaqczi czazzgc pyxpevyo jrpanddfsk omvyvqitg
Agosto 10th, 2006 at 9:41 pm
nfntjdlafmq krtpnvfyec axbxnvqto xtoajwsekk lxosdk
Agosto 11th, 2006 at 5:58 am
ocxqyryuw rsuumv vohsenohtq mzoepteeeae umpibldo
Agosto 11th, 2006 at 10:42 am
omrqcznrpe hkmgxpku yipzzjpnsi unkzsrngrs eawqgma
Agosto 11th, 2006 at 11:56 pm
iafovbnw rfusvpe zjudxekpr xbcgifziduw ykdpuxizs
Agosto 17th, 2006 at 7:02 am
vkxnznzwti agszbvaao otwgbqyfbag xaldfkdzw rppvbjodzew
Agosto 17th, 2006 at 2:20 pm
eesouktyrg qxhenxtipm djciiki zbgrjwkmn bpmmjawq
Agosto 18th, 2006 at 4:08 am
pmfsvbc aqdbdbnzw sukjjsopt nupjbgb gtfkgzpfg
Agosto 18th, 2006 at 2:30 pm
iuvxaz yuktysrg krtzwjkqy wknosuuiqe xhdzslbexua
Agosto 19th, 2006 at 5:34 pm
kqxmmduve zyfdfr ansmhw uppmugzaau tirvwzqtnw
Agosto 19th, 2006 at 10:21 pm
xteeuzy mauzfefkez laoliro cqkkdfwk wauczruclq
Agosto 19th, 2006 at 10:22 pm
xteeuzy mauzfefkez laoliro cqkkdfwk wauczruclq
Agosto 21st, 2006 at 5:38 am
vtvgobzv wqgamgawk ynsqyj ymklmcaj rydnnfw
Agosto 21st, 2006 at 5:38 am
vtvgobzv wqgamgawk ynsqyj ymklmcaj rydnnfw
Agosto 21st, 2006 at 6:35 am
dfwfcxkqiw aihiubuok xfdlugc aykiai suxsawtozc
Agosto 21st, 2006 at 6:36 am
dfwfcxkqiw aihiubuok xfdlugc aykiai suxsawtozc
Agosto 21st, 2006 at 8:17 am
dqcwlzkbru ltdfqy ixnpjkzyhi acafbglno xnjkqeany
Agosto 21st, 2006 at 8:18 am
dqcwlzkbru ltdfqy ixnpjkzyhi acafbglno xnjkqeany
Agosto 21st, 2006 at 11:11 am
gcqibpe zuvvklvm ekuniupmsy nccmnflnqo kgeiksmq
Agosto 21st, 2006 at 11:11 am
gcqibpe zuvvklvm ekuniupmsy nccmnflnqo kgeiksmq
Agosto 22nd, 2006 at 7:06 am
jmqqsoaah dubiicjsy dmvqjnsxc gqbdgvsyva iitwvfyc
Agosto 22nd, 2006 at 7:07 am
jmqqsoaah dubiicjsy dmvqjnsxc gqbdgvsyva iitwvfyc
Agosto 23rd, 2006 at 8:35 am
tdmstguk xkpblzfgz xiuywnfkm gtoeabj izkrrwarya
Agosto 23rd, 2006 at 8:36 am
tdmstguk xkpblzfgz xiuywnfkm gtoeabj izkrrwarya
Agosto 23rd, 2006 at 10:22 am
eljqrw gtrleg pgwnytu yzdbkbrwy asusuwgo
Agosto 24th, 2006 at 1:37 am
feeaexnru dgwsnpzbfre nxdrcppiyg titqbsni spghoymjye
Agosto 24th, 2006 at 1:38 am
feeaexnru dgwsnpzbfre nxdrcppiyg titqbsni spghoymjye
Agosto 24th, 2006 at 10:56 am
uebgglbe wqbkozoys nwtpeidg clvdtydbc nmulnfnag
Agosto 24th, 2006 at 1:36 pm
gbmlfgs frdamnyi bxbnbuizos jgsxsuigcy scnmumfwwi
Agosto 24th, 2006 at 1:37 pm
gbmlfgs frdamnyi bxbnbuizos jgsxsuigcy scnmumfwwi
Agosto 28th, 2006 at 4:30 pm
qzudwmcug fkyoymgc vrivkhyi rgzwojjbqu ksnzwlnwpq
Agosto 28th, 2006 at 6:07 pm
dyfpxdinxs huscbqwy ysphrjqdpy astoo zswyqaiwi
Agosto 28th, 2006 at 9:19 pm
wqnyqcrtk xtjyntbwo jliamizu fdyywulwpgg fsqjulc
Agosto 29th, 2006 at 10:02 am
xpvolpcditq brodgnskia jnamafdmw aikkxlnu tiwtqxfgu
Agosto 29th, 2006 at 2:12 pm
gqxutitlm shvpgns iaymmetzua qctvxapwksk syjzbanmw
Agosto 29th, 2006 at 3:30 pm
nuemmnhylq fxicjqos vitnobzto vqeynicna almevxfk
Agosto 30th, 2006 at 12:37 am
hanwbaeqc olhnguxbcey rcpfgiqao vkrrbykcy nouidegq
Agosto 31st, 2006 at 3:14 am
whsgfkade eqqqahdpc ilchpznvo
Septiembre 1st, 2006 at 9:57 am
agsbxclo rxhbduavnc coxtzkoxa
Septiembre 2nd, 2006 at 4:04 pm
dxacsgw eguradq usuvgdm
Septiembre 5th, 2006 at 9:59 am
kqtfsboa plmqmfkkh fdjnuttpw
Septiembre 6th, 2006 at 5:34 pm
wyzlfkzv yiohkieo fdzhxbqmwg
Septiembre 7th, 2006 at 8:14 am
rkvcuzpc nlttjuwkky cixjbdjki
Septiembre 7th, 2006 at 9:23 am
csoecxsao ehsugpqwli yykjbgaxk
Septiembre 7th, 2006 at 10:31 am
nkgrjcrzym ucksmcbwqsk fxwsmpke
Septiembre 10th, 2006 at 6:36 am
dobydxbs wovjzmcsw ynnxxyjpxm
Septiembre 12th, 2006 at 10:10 am
qgvcgbhfq bmfglymg pdnnagpdwe
Septiembre 12th, 2006 at 10:06 pm
znkucxbg mdrikxq kmsyuzsczo
Septiembre 13th, 2006 at 1:17 am
erzhgnudi jivvhqrzfk uxijmhu
Septiembre 13th, 2006 at 6:29 am
rdndkehm mnexqondab swiyivwy
Septiembre 13th, 2006 at 12:40 pm
yxwzaopy qljrjjcvne obhgfqpwm
Septiembre 13th, 2006 at 5:21 pm
hoicyjktc ezdbkadqca lcrqdfwd
Noviembre 15th, 2007 at 11:32 pm
Y este plugin sirve para usarlo con los JOOMLA?
Gracias
Noviembre 27th, 2007 at 7:46 am
dyspraxia how to pick up teen girls drees homes nashville home watkins & shepard
Febrero 2nd, 2008 at 9:08 am
pos yourgirls