Ads By Google

Adding The Edit Function To Your Posts.

A simple but yet useful function not found in many WordPress Themes is the “edit” function. I don’t know why , but even some of the best theme designers find it unnecessary to include this little piece of code in their themes.

The tiny “edit” button is found normally at the title bar or at the footer bar of every post and is only visible to the administrator. It allows the author to quickly make changes to the post if he detects some wrong spellings or something that doesn’t appear right in the post after hitting the publish button. Without that, they will have to go back to their dashboard all over again to access that post before they can edit it.

If your theme doesn’t comes with one, adding it yourself is not too difficult. It just a matter of inserting a single line of code to your Main Index and the Single Post File. Copy this line of codes entirely:

<?php edit_post_link(‘Edit’, ‘ | ‘, ”); ?>

To place it in your post title bar, look for the <div class= “post-meta-top”> tag in your Main Index php and paste it like the example below. Different themes might be written a little bit differently, but it will be more or less the same. Do the same thing for your Single Post php.

<div class=”auth”><span>Posted by <strong><?php the_author_posts_link(); ?><?php edit_post_link(‘Edit’, ‘ | ‘, ”); ?></strong></span></div>

The “edit” link will appear next to “Posted by XXX” in your post’s title bar.

Warning: As in tinkering with any codes in your templates, make sure to backup the whole file first. Just go to your Main Index php – right click-select all. Open your Notepad and paste the entire original file there. If you screw up, just copy the original files from your notepad, go back to your Main Index-right click-select all and paste back the original file. So keep experimenting until you are satisfied as to where you want the “edit” link to appear.

Share This Post
Ads By Google
 

Free Updates

Subscribe to receive Free WordPress Theme Tips, Reviews and Discount Codes

Related WordPress Theme Tips

Adding Thumbnails To WordPress 3 Default ThemeImage thumbnails has been built in as default since WordPress 2.9 and of course the latest WordPress 3. However, even when the function is available, most themes, including the default...

Customizing Your First WordPress ThemeFor those who wants to customize a WordPress Theme for themselves, the best place to start your experiments is the default theme that comes with your WoprdPress Installation. The default...

How To Edit The 7 Dollar Scipt – Download PageThe second template we must edit in the 7 Dollar Script is the download page. If you remember, to sell products in our WordPress blog, we will only be using...

How To Edit The 7 Dollar Script – Squeeze PageTo make the 7 Dollar Script work with our WordPress blog, we are only going to edit 3 templates. Since we are keeping things simple and lean, we will not...

How to Display AdSense in Single Posts with the Catalyst ThemeThis is a guest post by a blog buddy RT Cunningham, who is an An American Living In The Philippines. With both WordPress and the Catalyst Theme Framework, there is...

Those who found this page were searching for:

  1. themes blog shopping
  2. wordpress video tutorials edit function
  3. making money online wordpress theme
  4. wordpress edit button in single post
  5. the_edit
  6. adding functions to edit post
  7. wp edit posts in a function
  8. theme war cho blog
  9. ways to make a fool out of yourself
  10. free themes thesis 1.8

5 Responses to “Adding The Edit Function To Your Posts.”

Read below or add a comment...

  1. Sueblimely says:

    This is a handy hint. I have bookmarked it for future reference. Thanks

  2. Cfro says:

    Thanks for this info, but do you know what I need to do so that the edit doesn’t look like “edit”

    • Costa says:

      You can of course replace the word Edit within the quotation marks to any word you like. Some simply use the letter “e”

      Anyway, the word or whatever letter you use is only visible to you and no one else and even then, you have to be logged in to see and use the Edit function. So how it looks doesn’t really matter much.

Trackbacks

  1. [...] align” function. Those who wants to add in these functions can check out my previous posts, Adding The Edit Function To Your Post and Aligning Images With Your Stylesheet Details, Download and Preview The StudioPress WordPress [...]

  2. [...] feature missing in many themes that have “qualified” the top two criteria is the “edit post” function. I said many times before that I find it rather surprising that many top class theme developers [...]