How To Add Edit Button In WordPress Theme?

Posted by

Hi,

In order to add the edit button in individual posts or pages you need to edit single.php and page.php and add this code where you want to display the button:

<?php edit_post_link(__(“**Edit**”), ”); ?>

If you like to add the edit button on comments then you need to edit comments.php file of your theme and add this code where you want to display the button:

<?php edit_comment_link(__(“**Edit**”), ”); ?>

NOTE: These edit button will only appear if you are logged in with the appropriate priviledges like administrator, editor, etc.. Your blog traffic will not see them.

You can design the button in the way whatever you like to and then set its position in your stylesheet to appear where you want it to.

That’s it!

Thanks,

Shane G.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.