jeudi 5 octobre 2017

Pipe in unordered list titles and randomize items

I have a list of articles on my homepage, with a "read more" link to direct to the articles page:

<div class="articles_list">
 <ul>
  <li>Article 1</li>
  <li>Article 2</li>
  <li>Article 3</li>
  <li>Article 4</li>
 </ul>
  <div class="clear"></div>
   <div class="more"><a href="articles.html">and more...</a></div>
</div>

I want to change the titles, as I have more than 4 articles, and randomize them from time to time, without having to type them myself. For example, the list could be:

<div class="articles_list">
 <ul>
  <li>Article 5</li>
  <li>Article 1</li>
  <li>Article 8</li>
  <li>Article 4</li>
 </ul>
  <div class="clear"></div>
   <div class="more"><a href="articles.html">and more...</a></div>
</div>

Is there any way I could do that?




Aucun commentaire:

Enregistrer un commentaire