Archives months

From Photostand Wiki

Jump to: navigation, search
archives_months(prefix, months, link, suffix)

The archives_months function will return a list of lastest months used to browse the archives by months.

Parameters

  • Prefix : String value

HTML value that must be displayed before each category link.

  • Months : Integer value - Default : 12

Define how many months will be displayed in the list.

  • Links : Boolean value - Default : True

Define whether or not an HTML link must be added to each month.

  • Suffix : String value

HTML value that must be displayed after each category link.

Examples

In the archives.php page

Adding the months list

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
    <head>

	<title>Archives</title>

    </head>
    <body>

        <ul>
	    <?php echo archives_months('<li>', 12, 1, '</li>'); ?>
	</ul>

    </body>
</html>

In the above example, an HTML list containing each months will appear. There will be 12 months, starting from the most recent to the least one.

Personal tools