WordPress Footnoting

by scotslawstudent

1: <a name=”1″><a href=”#f1″>[1]</a></a>
2: <a name=”f1″><a href=”#1″>[1]</a></a>

These two lines of awkwardly nested code will provide you with clicky footnotes in HTML pages. It works fine for WordPress posts. It is pretty straight forward HTML but since it appears not to be an automated function in WordPress it needs done manually. I assume this would work in all blogging platforms as it just uses HTML, the markup webpages are written in. You need to be using the HTML view of the WordPress post screen to apply this, otherwise it will convert the greater and less than symbols etc into text rather than code and it will show up in your post instead of links. It’s how I did it in the previous post here and here.

I don’t believe anyone should copy and paste anything into their website/blog/program/terminal/contract/etc without knowing what it does so: The code works in four parts.

The first section of 1, <a name=”1″>, defines the content falling in between it and the </a> as an anchor called “1”. The second section of 1, <a href=”#f1″>, defines the content falling between it and the next </a> as a link to the part of the page defined as f1. This is applied to the superscript number in your body text – so in my previous post: “…at all times<strong>[1]</strong> a vindication…” Clicking this number will take you to the bottom of the post.

The first section of 2, < a name=”f1″>, defines the content falling in between it and then </a> as an anchor called f1. The second section of 2, <a href=”#1>, defines the content falling between it and the next </a> as a link to the part of the page defined as 1. This is applied to the superscript number in your footnotes – so in my previous post: “…<strong>[1]</strong> The arrests” Clicking this number will take your back to its reference number in the body text.

You need to rename each part of the footnote. In this example I’ve used 1 for the reference in the body text and f1 to refer to the footnote. I would increment this to 2 and f2 for the next footnote. I would rename this entirely for the next post, however, because it gets confusing to have links which effectively point to other posts on the main page of your blog. In this case if you put a letter in front of 1 and f1 to create “a1” and “af1”, in the next post you could use “b1” and “bf1” and the two could coincide in full on your main page with no problems.

Feel free to email or comment for clarification. I’m not a technical writer for a reason.

Advertisements