A simple but yet useful function not found in many WordPress Themes is the “edit” function. I don’t know why , but even some of the best theme designers find it unnecessary to include this little piece of code in their themes.
The tiny “edit” button is found normally at the title bar or at the footer bar of every post and is only visible to the administrator. It allows the author to quickly make changes to the post if he detects some wrong spellings or something that doesn’t appear right in the post after hitting the publish button. Without that, they will have to go back to their dashboard all over again to access that post before they can edit it.
If your theme doesn’t comes with one, adding it yourself is not too difficult. It just a matter of inserting a single line of code to your Main Index and the Single Post File. Copy this line of codes entirely:
<?php edit_post_link(’Edit’, ‘ | ‘, ”); ?>
To place it in your post title bar, look for the <div class= “post-meta-top”> tag in your Main Index php and paste it like the example below. Different themes might be written a little bit differently, but it will be more or less the same. Do the same thing for your Single Post php.
<div class=”auth”><span>Posted by <strong><?php the_author_posts_link(); ?><?php edit_post_link(’Edit’, ‘ | ‘, ”); ?></strong></span></div>
The “edit” link will appear next to “Posted by XXX” in your post’s title bar.
Warning: As in tinkering with any codes in your templates, make sure to backup the whole file first. Just go to your Main Index php - right click-select all. Open your Notepad and paste the entire original file there. If you screw up, just copy the original files from your notepad, go back to your Main Index-right click-select all and paste back the original file. So keep experimenting until you are satisfied as to where you want the “edit” link to appear.

This is a handy hint. I have bookmarked it for future reference. Thanks