Site logo

[Resolved] Edit Link in Published Post

Home Forums Support [Resolved] Edit Link in Published Post

Home Forums Support Edit Link in Published Post

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #736288
    Dave

    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!

    #736457
    David
    Staff
    Customer Support

    Hi there,

    You could use the GP Hook Elements to add this PHP snippet:

    <?php edit_post_link(__('Edit'), ''); ?>

    #736479
    Dave

    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>?

    #736483
    David
    Staff
    Customer Support

    Yes, you can use the wp_header hook

    #736494
    Dave

    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!

    #736503
    David
    Staff
    Customer Support

    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.

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.