How To Make Your Post Title Link To Single Post

Windows, GNOME and KDE keys for cut and pastin...Image via Wikipedia

For most themes, when you blog you will end up with anywhere from 3 to 10 blog posts on one page. This allows new readers to easily scan your posts and find topics of interest to them.

You can easily make these post summaries by adding the <!–more–> tag where you want the text to break and readers will see the “click here to continue” or “read more”. WordPress makes it one step easier by including the more code under the HTML tab so you can insert it with one click.

However, some WordPress Themes do not permalink the blog post titles to the actual single page post and the only way to get to the single post is by clicking on that more link.  I personally find this frustrating.

My current theme does not allow for the title link so I decided to hunt down and change this by once again hacking up the theme files.  I was happy to find that it took one piece of cutting and pasting code that I found at this very helpful website,Lorelle on WordPress.  I know the same information is in the WordPress codex but for some reason, I found it easier to understand on the above site.

I then went to my dashboard – design- theme editor and opened my index file.

I copied the following piece of code from the above website

<a href="<?php the_permalink() ?>" title="<?php the_title(); ?>"><?php the_title('<h2>', '</h2>'); ?></a>

I found the small snippet of title code in my index theme and pasted the above code over it. Of course- before making any changes to your theme code, I always recommend you back it up or simply copy the code and paste it into notepad so that if something goes horribly wrong you can paste the original code back.

However, with that simple little five minute fix (that took me an hour to find) my post titles are now linked to their respective single post page. Voila!  It looks like I know PHP… but really I’m only copying and pasting.. even you can do it!

Reblog this post [with Zemanta]
, , , , , , ,

One Response to “How To Make Your Post Title Link To Single Post”


Trackbacks/Pingbacks

Leave a Reply