After you publish a post, you'll often want to go back and update facts as more becomes available on a developing story, or to correct spelling and grammar errors that you've noticed after reading through it. Rather than force your theme's users to log in and search to find the post to edit, you can provide a link to the editing page directly in your theme.
Open a template file where you are displaying posts in the The Loop. Decide where you want the edit link to appear. It can appear anywhere inside The Loop. Place your cursor at that point and insert the following code:
<?php edit_post_link('Edit this entry','','.'); ?>
The edit_post_link
function detects the currently logged in user's role and capabilities. If the user is logged in and he or she has the ability to modify the post that is currently being displayed, then the Edit link appears.
Three parameters are used to format the link. The first parameter allows for...