Add Post Edit Link

How To Add Post Edit Link Below Every Post of Your Website?

When you open any post of your while logging to WordPress admin panel, do you see an edit option below the post title? What would you do to add post edit link for all the posts if you won’t find it on your website?

It’s is possible that your WordPress theme doesn’t consist this feature to show the edit option. If not, then you have to add it manually using the WordPress function.

In this tutorial, I will walk you through the process to add post edit link below the title so that you would be able to edit any blog post.

No one wants to search for the post in the WordPress, it’s great just to click on the “edit” option below the post title and reach to the WordPress post editor.

Add Post Edit Link For Posts To Improve Users’ Experience.

While developing a WordPress theme, a developer should take care of the user. He/she should try to manage the things with the proper code and the easy handling options.

Just like you add author name and date, and comment number below post title, you can add post edit link. The code will be embedded in the same line.

Let me provide you the code.

<?php edit_post_link(); ?>

Add this code in the single.php file of your theme below the post title or wherever you want to show this option. You can show this option in the same paragraph of the author name and the date.

NOTE:- This option will be visible only to the website owner after logging to the WordPress admin panel.

There are many parameters you can pass along with this. After adding this code, you will see the “Edit this” link below each post.

If you want to change the default text then you can pass the parameter.

<?php edit_post_link(‘Edit’); ?>

This will only show “Edit” in place of “Edit this“. It’s your choice whether you want to keep the default edit text of want to use your own.

<p><?php the_time(‘F jS, Y’); ?> | by <?php the_author(); ?> | <?php edit_post_link(); ?></p>

The above code will show the date, author, and the post edit link.

Though most of the developers like to keep it below the post title but still if you want to use it anywhere else then you can.

I Hope Now You can Add Post Edit Link To Your WordPress Website?

Just one line of the code would do the work. You just have to use the WordPress function mentioned above. As I have mentioned above, the parameters can be passed but still, default one won’t hurt you.

There are many parameters other than changing the default edit text. But for the perfect solution, it’s more than enough. If you still want to know more then I can help you.

by Ravi Chahar

A WordPress Professional and the LinkedIn Influencer. A coder by passion and a blogger by choice. WordPress theme development is his forte. He is your WordPress guy who will teach you how to solve WordPress errors, WordPress security issues, design issues and what not.


Get Free Updates Into Your Inbox

Learn Everything Just Like I Did

SUBSCRIBE



4 comments

  1. Hi Ravi,

    This is such a helpful post! I remember using themes that did not have this option and it bugged me. Thankfully, most of the StudioPress or other Genesis themes I use have it. I’ve often published a post and found a typo or grammatical error. Having that little link makes it that much easier to fix.

    Thanks for showing us how to code it!

    B

    1. Hey Bren,

      Though most of the premium themes have the edit link and the users can do a lot of changes whenever they want. It’s normal to notice the errors after publishing the posts. But when we don’t find the edit link, it can be frustrating.

      Glad you found it helpful.

      Have a great day.

      ~Ravi

  2. Hi Ravi,

    This was really helpful. Keep sharing these kinds of post.

    have a great day.

    Thanks sharing.

Leave a Reply

Your email address will not be published. Required fields are marked *