recent_comics

recent_comics(howmany,before,after) — display a list of the most recent comic posts

Description

This tag displays a list of links to the howmany most recent comics (five by default).

By default, this tag just vomits out a series of links, with nothing to separate them. If you like, you can add before and after arguments to enclose each list item in HTML tags.

Usage

Example A.15. Basic Usage

<?php recent_comics(); ?>

This would produce the following output:

<a href="http://example.com/?p=222">Comic for January 4, 2009</a>
<a href="http://example.com/?p=218">Comic for January 3rd, 2009</a>
<a href="http://example.com/?p=194">Comic for Friday, January 2nd, 2009</a>
<a href="http://example.com/?p=193">Comic for Thursday, January 1st, 2009</a>
<a href="http://example.com/?p=211">Comic for Monday, December 29th, 2008</a>

Example A.16. Advanced Usage

<?php recent_comics(6,'<li>','</li>'); ?>

This would produce the following output:

<ol>
	<li><a href="http://example.com/?p=222">Comic for January 4, 2009</a></li>
	<li><a href="http://example.com/?p=218">Comic for January 3rd, 2009</a></li>
	<li><a href="http://example.com/?p=194">Comic for Friday, January 2nd, 2009</a></li>
	<li><a href="http://example.com/?p=193">Comic for Thursday, January 1st, 2009</a></li>
	<li><a href="http://example.com/?p=211">Comic for Monday, December 29th, 2008</a></li>
	<li><a href="http://example.com/?p=210">Comic for Sunday, December 28th, 2008</a></li>
</ol>

Arguments

argument type default description
howmany integer 5 How many items to show
before string   Text to display before each comic listed; common use would be an HTML tag such as <li>.
after string   Text to display after each comic in the list; common use would be an HTML tag such as </li>.