This WordPress snippet will add an “edit page” link on the WordPress posts and pages. Only users who are logged in and have the necessary rights to edit that page will be able to see this link (administrator or author).
Add the snippet to the theme page where you want the link to appear, for example, add it next to the title in GeneratePress theme edit the single .php file and add:
<?php edit_post_link(__('Edit This')); ?>

Source: https://codex.wordpress.org/Function_Reference/edit_post_link
Was this post helpful?
Let me know if you liked the post. That’s the only way I can improve. 🙂