ClsHack:Computer Security Blog    

WordPress:Script ultimi n articoli.


Se volete visualizzare, gli ultimi n articoli inseriti su wordpress potete utilizzare questo codice:



  < ? php
   $myposts = get_posts("numberposts=4");
  ?>

E :



   < ? php foreach($myposts as $post) :?>
	 < a href="" title="Vai all'articolo < ?php echo get_the_title(); ?>">
	  < ? php
echo substr(the_title("","",false),0,40)."...";
?>
   < ? php endforeach; ?>


Il codice, mostra gli ultimi 4 articoli pubblicati.

Se volete modificare ciò dovete sostituire numberposts=4 con numberposts=NUMERO ARTICOLI

Related posts:

  1. Classe wordpress per facilitare le cose
  2. [guida]Creare Script php AUTOMATICO
  3. Aggiungiamo: Anteprima Articolo a wordpress
  4. Script login php-mysql con cookie
  5. [php/mysql] semplice script login con sessioni

This entry was posted on Saturday, August 29th, 2009 at 11:28 am and is filed under Programming. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

Tagged with: