Code Snippet
“Edit This” Button on Posts and Pages
<?php edit_post_link(__('Edit This')); ?>Put this in the theme file somewhere near where you output the_content() (likely in the single.php or page.php file) to make a link you can click that takes you into the admin to edit it. This link will only be visible when the viewer is logged in and has appropriate permissions to edit that page (administrator or author).
Real handy thing to have in the theme.
I’d like to add that:
* It should, ofcourse, be used within the loop
* And that aside from admins and post-authors, (global) ‘editors’ also see this link. Maybe obvious, but thought I’d say it here for completion.
– Thanks to whomever sent this in :)
You’re welcome :)
perfect solution
Glad you found it useful! :)
A perfect place to put is just next to the content excerpt.
wow, great, thanks friend
Thanks for sharing all this good stuff!
Thanks
Good tips, but new WordPress version provides this feature by default.
Note. If you are using in your WordPress template for localization files (*. mo, *. for).
And since you can just:
Misprint «*. for», PO-files
I’ve noticed the new WP provides this anyway. Anyone else?
DigWP
A book and blog co-authored by Jeff Starr and myself about the World's most popular publishing platform.
Quotes on Design
Design, like Art, can be an elusive word to define and an awfully fun thing to have opinions about.
HTML-Ipsum
One-click copy to clipboard access to Lorem Ipsum text that comes wrapped in a variety of HTML.
Bookshelf
Hey Chris, what books do you recommend? These, young fertile mind, these.