WordPress Tools: MW-Style Calendar
A variation on the month-view calendar that comes with WordPress. This version, in addition to accepting the daylength
parameter, also accepts string parameters for three symbols to go after the next month link, before the previous month link, and between the two to represent "go to blog home." The month-and-year at the top of the calendar is a link to the current month's posts. This version of the calendar also adds class="posts"
to the cell of any date containing posts, and class values of first
or last
to the first or last cells in a given table row. Finally, the calendar does not generate a tfoot
at all if there are no previous or next months (unlikely, but it happens).
- Version: 1.2
- Date: 4 April 2005
- Download: mw_get_calendar.php
Functional Reference
<?php mw_get_calendar('daylength', 'nextSymbol', 'prevSymbol', 'currentSymbol') ?>
daylength
(string)-
The length of the abbreviations for the days of the week shown across the top of the calendar. For example,
'1'
causes "Sunday" to be displayed as "S",'2'
causes it to be "Su", and so on. Defaults to'1'
. nextSymbol
(string)-
A string that is inserted after the link to the next month in the archive, assuming that there is one. This can be any string, including character entities such as
→
(right arrow) and Unicode references such as⇥
(rightwards arrow to bar). Note that Unicode support is not universal, so test thoroughly. Defaults to''
(null string). prevSymbol
(string)-
A string that is inserted before the link to the previous month in the archive, assuming that there is one. This can be any string, including character entities such as
←
(left arrow) and Unicode references such as⇤
(leftwards arrow to bar). Note that Unicode support is not universal, so test thoroughly. Defaults to''
(null string). currentSymbol
(string)-
A string that is inserted between the previous and next-month links (see above) and which become a link that points to the blog home (most recent posts). This can be any string, including character entities and Unicode references. Note that the cell into which it is inserted is only one column wide, so it's best to stick to symbols of some sort. Defaults to
''
(null string).