Igor Kromin |   Consultant. Coder. Blogger. Tinkerer. Gamer.

NOTE: This article is 3 years or older so its information may no longer be relevant. Read on at your own discretion! Comments for this article have automatically been locked, refer to the FAQ for more details.
Most blogs provide a permalink option for every blog entry, this is something I've noticed was missing from the FlatPress themes I've tried.

A little tweak to the entry-default.tpl file is all that's needed to add a permalink for each entry. The only restriction with the code below is that it assumes that the blog is in the root directory of the domain. If the blog happens to be in a subdirectory off the root, it's quite easy to change by putting the subdirectory name before the '/?x'.

Here's the end result:

I chose to use an image to make the link instead of just text. The permalink sits inside a div, which I position using CSS.

This is the code to add the actual link itself:
<div class="permalink">
<a rel="bookmark" href="/?x=entry:{$id}">
<img src="/perma.png" border="0" height="12" width="20" title="Permalink" alt="Permalink">

This is the CSS to position it (res/style.css):
#main .permalink {
float: right;
clear: both;
margin-right: 6px;


Skip down to comments...
A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. If you spot something out of place, please do let me know.

All content and opinions expressed on this Blog are my own and do not represent the opinions of my employer (Oracle). Use of any information contained in this blog post/article is subject to this disclaimer.
comments powered by Disqus
Other posts you may like...