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

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:
permalink2.png



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">
</a>
</div>


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


-i

A quick disclaimer...

Although I put in a great effort into researching all the topics I cover, mistakes can happen. Use of any information from my blog posts should be at own risk and I do not hold any liability towards any information misuse or damages caused by following any of my posts.

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.
Hi! You can search my blog here ⤵
NOTE: (2022) This Blog is no longer maintained and I will not be answering any emails or comments.

I am now focusing on Atari Gamer.