As lot of themes use the_content()
to display the post content. you can use the_content
filter hook to add the edit link before/after the content.
Since you want this work outside themes, you have to put the following code in a file, and store it in your plugins folder then activate it as a plugin.
<?php
/**
* Plugin Name: Add Edit Link in Frontend
* Description: Append post edit link to content
* Version: 1.0.0
*/
function wpael_content_edit_link( $content ) {
$content .= '<br /><div style="font-size: 14px"><a href="'. get_edit_post_link( get_the_ID() ) . '">Edit</a></div>';
return $content;
}
add_filter( 'the_content', 'wpael_content_edit_link', 10 );
Related Posts:
- Who are the most trusted plugin developers? [closed]
- How Does WordPress Uninclude/Deactivate A Plugin?
- WordPress plugin for mail subscriptions [closed]
- Let user subscribe to specific categories
- Is there a way to alter the order in which the plugins appear in the page?
- How can I implement a notification system in wordpress?
- How to make a customize role and view a specific plugins base on that role?
- Woocommerce plugin for minimum order and add-to-card-step
- How would I go about creating a user ranked post popularity page?
- Create a plugin from within WordPress
- Can I use Symfony components in a plugin that I want to submit to the WordPress plugin repository?
- creating a plug in that would tap into save/update action of posts [closed]
- breadcrumb need to show all pages and subpages
- Possible?? Pull Plugin Property Data to a Theme’s Custom Post Type
- How to use existing hook in twentytwelve to all theme of wordpress?
- How to get Recent Post From Each Category with Thumbnail?
- Personality quiz in wordpress using a plugin
- Access remote SFTP server via WordPress login?
- Create survey that redirects to sidebar menu customized to answers
- How to put a maximum real-time users limit
- Using Taxonomies with Vote It Up plugin chart [closed]
- How can I create a navigation menu in the sidebar that can also act like a slider?
- contact form 7 captcha support anyother captcha plugin? [closed]
- Take Elementor For Email FIeld Check if user is registered. IF not registered then register on woocommerece
- how to make wordpress remember my choice
- I’m getting the following error: Fatal error: Uncaught Error: Call to undefined function oil_paint_regeneration() [closed]
- What are Seeds? [closed]
- Get plugin directory from a theme
- Recommended eCommerce Plugin for a T-Shirt Sales Business? [closed]
- Rewriting every url
- category_name not working (not showing up in sql query debug)
- Custom admin column disappearing when using Quick Edit [duplicate]
- Create page when plugin is activated
- Custom plugin settings: clicking “save changes” does not display success message
- How to un-attach rich text editor from named textarea elements
- How can I translate the name of my Plugin for other languages?
- how to not show plugin in admin area
- Memory Leak in plugin action
- Getting User email on logout. wp_logout
- How can I filter blog name?
- Logs to check when the plugin was first installed for the first time
- Can a plugin add to header/footer/body content?
- Detect if a plugin was included in a certain page
- How Can A Plugin Hook Itself To the End of Every Excerpt?
- Allow Facebook to preview posts before published
- add action for displaying posts using a shortcode
- Best way to hook a custom url?
- How do I add a custom sub menu menu under Woo-commerce marketing?
- How to load plugin after page is loaded – pagespeed issues
- How to create custom tables in WordPress using my own plugin?
- Making a Template for a CPT created by a plugin
- Woocommerce dependent plugin
- External CSS in WordPress Plugin [closed]
- User Session and Stored Cookies not get removed
- LinkedIn Social Wall | Is there a plug-in (Free / Paid) to display a LinkedIn feed in a social wall (not just a feed)?
- Create a navbar filter that filters by a custom field
- get 404 when accessing wp-admin/plugin-install.php
- Woocommerce Minimum Price for a Composite Product to add in cart
- add tabs in rdp-plugin/includes/settings.php and get settings saved
- Plugin Development Form Self Submission
- How To Extend A WordPress Plugin Without Losing Your Changes [duplicate]
- Does a blank plugin come with any overhead?
- Admin AJAX doesn’t work in plugin admin page – Even though code is copied verbatim from WordPress Codex
- WPDB: Update table
- Why is my custom post type not being activated on plug-in activation?
- update_option_{$option} not showing old value
- A server-side hook failed when committing plugin code to SVN
- Content-Security-Policy Headers are there and showing the correct settings, but still getting a refused connection
- SMTP Error: Could not authenticate [closed]
- Development of plugins to add components like JqueryUI
- plugin enqueue style on all pages
- How to delete all categories programatically?
- Adding submenu to custom plugin menu page created with add_menu_page() function
- What is necessary to secure a WP plugin against direct file access attempts?
- why the wp_register_script doesn’t work for register_activation_hook
- Add a Custom Field in Comment Box next to the Text area
- How do you create a re-useable HTML fragment in wordpress
- Set Button in PluginDocumentSettingPanel Content (WordPress Gutenberg)
- GitHub plugins safe to use in my website?
- woocommerce: Customize email with item total count
- The styles in the recent posts widgets plugin not working
- Link custom post type to page
- implement checkbox or toggle switch in plugin code
- wordpress form not saving or updating
- Custom admin plugin read CSV
- How can I call functions from a custom plugin?
- How to get short description under heading – Visual Composer [closed]
- plugin installing error
- Why the output of an image gallery plugin is not displayed into a page of my custom theme?
- How can I use wp_ajax_response for front-end error reporting?
- Force download a file within plugin file
- How can I use multi Media Uploader in a plugin?
- Is it possible to run javascript on plugin deactivated?
- Can someone please help me find a solution to my youtube embed problems? [duplicate]
- Gutenberg: Dynamic Block – Show saved data in the editor
- How to fix ‘Call to undefined function do_settings()’ error?
- How do I copy files I downloaded from the wayback machine to my new site?
- WP Elementor Pro causing crtical failure on website
- Function not being called on form submit, only blank admin-post.php page
- How to give specific class name to category in wordpress with code snippets