Stephanie Leary

Writer and WordPress consultant

  • Books
    • Content Strategy for WordPress (2015)
    • WordPress for Web Developers (2013)
    • Beginning WordPress 3 (2010)
  • Blog
    • Fascism Watch (2016-17)
    • Content Modeling for WordPress series
    • WordPress Hidden Gems series
  • Work
    • Portfolio
    • Services
    • WordPress Plugins
    • WordPress Themes
    • Presentations and Interviews
    • on GitHub →
  • About
    • Press Kit
  • Contact
    • Mailing List

Various tricks with archive calendars

January 20, 2003 Stephanie Leary

These tricks apply to the tiny calendars that appear on your home page, not the full-screen monthly archives from my last post.

How to link to a full day’s entries instead of the last one on that day: – Turn on daily archives. – In your calendar code, replace this:

<MTEntries lastn="1"><a href="<$MTEntryPermalink$>"><$MTCalendarDay></a></MTEntries>

with this:

<MTEntries lastn="1"><a href="<$MTEntryLink archive_type="Daily">"><$MTCalendarDay$></a></MTEntries>

*****

How to print all monthly archive calendars (past, current, future) on one page: Read about it in &#8221;>this thread. If you’re not using your Master Archive Index for anything special, it’s perfect for this. Use it instead of creating another template; after all, if you screw it up, you can get the default code again from the MT site.

To get all the tiny calendars in the Master Archive Index [Example], use this:
<MTArchiveList archive_type="Monthly">

Add this style definition for table in your header:

Do not put that style in your global stylesheets, as it will alter the display of every table. The height attribute might make these tables look a little different than the ones on your home page, but it's necessary to get the calendars to line up in neat little rows. (Most of you probably won't even notice what I'm talking about.)

There are other ways of doing this – Kristine's tutorial, for one, uses tables to accomplish a similar layout. There's also Brad Choate's Yearly Archives plugin to organize everything.

*****

You can use the same MTArchive code with lastn to put 2 or 3 tiny calendars on any other template:
<MTArchiveList archive_type="Monthly" lastn="2">

However, if you have posts dated farther into the future than that, you might not end up with the months you want. If this happens, try Brad Choate's Supplemental Calendar Tags plugin. This will give you an offset value. Now you can keep your original calendar code from the default template, and add a second one using . You can use a negative offset to get last month's calendar instead of next month's, or you could go several months ahead… play with it!

*****

To make your calendar title a link to the full-screen month view, write your calendar head like so:
<caption class="calendarhead"><a href="<$MTArchiveLink>"><$MTArchiveDate format="%B %Y"$></a></caption>

[updated Feb. 10, 2003]

Blogging

  • Facebook
  • Github
  • Google+
  • Pinterest
  • Tumblr
  • Twitter

Fascism Watch

The Fascism Watch is a daily(ish) news roundup. View all the previous Fascism Watch posts »

Latest WordPress Book

Content Strategy for WordPress

A short book for content strategists and managers on implementing a complete content strategy in WordPress: evaluation, analysis, content modeling, editing and workflows, and long-term planning and maintenance.

Read the sample chapter

Kindle Nook iBooks Kobo Smashwords

WordPress for Web Developers

WordPress for Web Developers (9781430258667)

This is a book for professional web designers and developers who already know HTML and CSS, and want to learn to build sites with WordPress. The book begins with a detailed tour of the administration screens and settings, then digs into server-side topics like performance and security. The second half of the book is devoted to development: learning to build WordPress themes and plugins.

This is the second, much-revised and updated edition of Beginning WordPress 3, with a more accurate title. Everything’s been updated for WordPress 3.6.

WordPress for Web Developers is out now. See what's inside...

The best WordPress features you’ve never noticed

  • WordPress Hidden Gems: Screen Options
  • WordPress Hidden Gems: Bulk Edit
  • WordPress Hidden Gems: Private Status
  • WordPress Hidden Gems: Dashboard Feed Readers
  • WordPress Hidden Gems: Options.php

Content Modeling for WordPress series

  • Content modeling for WordPress, part 1: analyze content
  • Content modeling for WordPress, part 2: functional and organizational requirements
  • Content modeling for WordPress, part 3: a sample content model

This is an excerpt from Content Strategy for WordPress.My latest books are Content Strategy for WordPress (2015) and WordPress for Web Developers (2013). Sign up to be notified when I have a new book for you.

Copyright © 2018 Stephanie Leary