Sunday, July 7, 2013

How to add “Edit This” Button Link on Posts and Pages

Add code below somewhere near where you output the_content() in your single.php or page.php file of your template to make a link you can click that takes you into the admin to edit it. This link will only be visible when the viewer is logged in and has appropriate permissions to edit that page (administrator or author).

edit_post_link(__('Edit This'));
</pre>
Disqus Comments