Archived topic
Edit Link in Published Post
5 replies · Started by Dave on November 23, 2018
Anyway to get an 'edit' link in a published post? My prior themes have an 'edit' link at the end of the byline and it's been super efficient for post updates. I tried searching the forum, but it can be a bit tedious, sorry. Thanks!
Hi there,
You could use the GP Hook Elements to add this PHP snippet:
<?php edit_post_link(__('Edit'), ''); ?>
Perfect, thank you! Could I use this same technique if I needed to add a snippet of code to the functions.php file and between <head></head>?
Yes, you can use the wp_header hook
Anything for functions.php? I use a little snippet of code to disable Jetpack social icon comment counts. Would be nice if I could add it off to the side so theme updates won't disrupt. Thanks for all your help as usual!
Hooks should just be used for outputting content, adding scripts (JS) or things like meta. Filters (add_filter), Shortcodes (add_shortcode), or specific plugin or theme hooks (add_action) should be kept in your function.php.