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:
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

Skip down to comments...
Hope you found this post useful...

...so please read on! I love writing articles that provide beneficial information, tips and examples to my readers. All information on my blog is provided free of charge and I encourage you to share it as you wish. There is a small favour I ask in return however - engage in comments below, provide feedback, and if you see mistakes let me know.

If you want to show additional support and help me pay for web hosting and domain name registration, donations, no matter how small, are always welcome!

Use of any information contained in this blog post/article is subject to this disclaimer.
 
comments powered by Disqus
Other posts you may like...