The Movable Type Knowledge Base

Keep an Entry on Top

Question

How can I keep an entry on the top of my weblog's main page?

Answer

Sometimes, you may have an announcement or other important entry that you'd like to stay above the other entries on your weblog. There are several ways to do this.

Post-Date the Entry

The easiest method is to change the Authored On date of your entry to a future date. This will keep it at the top of any listings sorted by date, until an entry with a later date is published.

Edit the Main Index Template

For a note that will always stay on the top and rarely needs to change, editing the Main Index Template to contain the static information may be a good alternative.

Use a Plugin

You can use the Entry plugin to insert code in your template that will always refer to a particular entry.

Use a Special Category

If you have a regularly changing notice you'd like to keep on top, create a new category named Announcements. Then in your Main Index Template before the current <MTEntries> tag, add code similar to this:

<MTEntries lastn="1" category="Announcements">
<$MTEntryBody$>
</MTEntries>

The newest entry in that category will be displayed on the top of the page at all times.

Note that you may wish to also consider using the ExcludeCategories plugin to keep entries in the Announcements category from appearing in your normal listing of entries.

Submit Feedback on This Article

Your comments on how we can improve this article are appreciated; but please do not use the feedback form to submit support requests or questions. We will not respond to or publish such queries submitted through this form. If you have a technical question or problem, visit Movable Type Support.

Yahoo! Small Business web hosting services

Six Apart
Makers of weblog software and services for individuals, organizations and businesses.
This website is powered by Movable Type.