fbpx
How to Add an "Edit Page-/Post" Link to WordPress Posts and Pages

How to Add an “Edit Page-/Post” Link to WordPress Posts and Pages

Put this in the theme post-/page file to make an “Edit Page” or “Edit Post” link in your template file – that takes you into the admin page-/post edit mode. This link will only be visible when the viewer is logged in and has appropriate permissions to edit that page (administrator or author).
<?php edit_post_link(__('Edit This')); ?>

Related links:
https://codex.wordpress.org/Function_Reference/edit_post_link

WordPress Hosting

Leave a Reply

Your email address will not be published. Required fields are marked *

WordPress Snippet Info

Tested with Wordpress v. 4.7.3
Last Modified: 15.05.2017
Last Reviewed: 15.05.2017

How to Add an “Edit Page-/Post” Link to WordPress Posts and Pages
4.5 (90.91%) 11 vote[s]
Please report broken snippets.
Report Broken Snippet