Adding edit post/page link


Has anyone applied <?php edit_post_link(); ?>

Where should it be placed?


Hey Dee, I am happy to provide you with the snippet to add it from your child theme. Where would you like the Edit link to be located (eg. below post content)?

Thanks,


Yes - that would be fine.


Hi Dee, the snippet below should be what you are looking for:

add_action( 'beans_post_body_append_markup', 'example_edit_post' );
/**
 * Edit post link.
 */
function example_edit_post() {
  ?><p class="uk-margin-bottom-remove"><?php edit_post_link(); ?></p><?php
}

You may change the text of the edit link by setting it as the first parameter of the edit_post_link() function.

Happy coding,


Thank you Thierry.

Customizing it to fit my needs.

Write a reply

Login or register to write a reply, it's free!