You’ve already been pointed to the correct approach and the answer is functionally identical to any of the answers here about appending data to post content. All you need is something like:
function my_function () {
echo 'my function content';
}
add_action('the_content','my_function');
To restrict that to single post pages:
function my_function () {
if (is_single()) {
echo 'my function content';
}
}
add_action('the_content','my_function');
Related Posts:
- Where is the best place to use add_filter
- Edit plugin without hooks in functions.php
- Using add_filter inside another class
- How to list the Hooks and order of execution in current loading page? [duplicate]
- Pass A Value From Outside To A Plugin Variable
- Failed to invoke other hook from the init hook
- How can I filter blog name?
- Custom preview_post_link not working for draft post
- Add Fields with Sub-Fields to WP Job Manager
- Determine plugin name from within plugin_action_links filter
- merging an array to an existing array using add_filter
- Creating a plugin to sanitize comment and the url field before display only
- How to find the origin of a file upload from within wp_handle_upload?
- White page by using filter template_include
- How to check current user before all actions and filters?
- Create a navbar filter that filters by a custom field
- Passing an array from shortcode-function to filter-function
- Get Time Taken By Each Action Hook in WordPress
- qTranslate remove default directory from link
- How to change the name of the “edit my profile” link in the WordPress admin backend
- Proper way to replace the_content only for pages created by custom plugin
- add_filter doesn’t work
- Redirect to another page using contact form 7? [closed]
- Check if variable is set in filter
- Check filter defined or not?
- what is the point of telling add_filter how many parameters you want passed to the function?
- How to add filter for wordpress plugin?
- How to use add_action for multiple instances of the same class
- How to append new form elements in “Add New” form of Users in WordPress admin panel?
- Want to create custom design of progress indicator in wpforms
- Add hook after content without formatting
- Using OR Condition with facetwp facets
- 500 Internal server error wp_handle_upload_prefilter
- Nested Actions and Filters
- Remove action added in plugin class from theme
- Using multi-dimensional array with filter
- Can I add content before post content without using the_content filter
- WordPress Add advertising ads befor and after content with periority [closed]
- trying to create simple plugin to filter categories from all authors
- shortcode which is introduced into entry the blog, and appears in side bar
- How do i get all author posts on custom post type list
- Unable to pass arguments from plugin form to filter hook using ajax, the data is transferring via ajax but unable to pass as arguments in filter hooks
- How can we extent core/group or cover block?
- Why do I get this “plugin does not have a valid header” error?
- Making plugin unique to not conflict with plugins with the same name
- How to find out if option exists but is empty?
- Is dynamic forms/entries possible in Widget?
- How to get posts by content?
- Trigger a custom wordpress plugin with a linux cron
- Add_rewrite_rule doesn’t add custom url in plugin
- How to add inline css/js inside a shortcode
- Is this plugin being loaded before file.php, subsequently not allowing me to use certain functions?
- Plugin not saving values when placed in a folder within /wp-content/plugins
- How to integrate plugin in WordPress theme
- How do I write into a file (css)
- Loco Translate: Custom Post and Custom Taxonomy Labels not translated in wp-admin menu
- Where should I save an API key of my user when installing my plugin?
- Allow users of my plugin to define their own shortcode rather than use mine?
- Display update notification messages like ‘What’s New’
- CRUD and Frontend show from a custom table without shortcode
- How can I make 2 plugins that include different versions of a framework to both use the latest version?
- Add Plugin options as subpage to Theme options page
- Image upload and download from front-end
- correct way to include a library(and its dependent libraries) in wordpress development
- Issue Tracker from pre exsisting table [closed]
- Git Hosting for WordPress SVN Plugin Repository [closed]
- Is there a directory my plugin can write files to that cannot be viewed via the browser/url?
- How to exclude certain files from the plugin editor?
- How to create a child/addon plugin
- How to secure the release of WordPress plugins / avoid copying plugins?
- how to force tag page layout to use same as search layout?
- Delay JavaScript files from loading
- Run function on plugin activation before plugin is loaded
- Gutenberg Block Style CSS Class Is Not Applying on Backend
- remove_action not removing add_action from constructor
- WordPress custom plugin that uses woocommerce enabled payment gateway for payment [closed]
- How to call external functions from a PHP script in a WordPress plugin?
- Plugin generated unexpected output – No PHP errors
- Can we give Pending as a Role to wp_insert_user?
- Custom page from wp admin area
- Scrape key check failed. Please try again
- Avada Live is broken on WP
- Is there any way to sync Facebook Comments and with comments on WordPress website?
- Woocommerce convert simple products to variations
- WooCommerce Product Table – filter query on attributes
- Disable WC Bookings automatic order completion [closed]
- Block content rendering on the top just below body tag
- WordPress “template_include” Filter Not Working
- WordPress not displaying information on post sent from custom admin form
- Buddypress Member list not showing admin and mods
- Editing a built plugin: How to activate it only on a single post page
- Building a simple “settings” plugin to change textstrings on the home page
- Couldn’t find a documentation for a filter API in plugin development
- My wordpress website admin panel loads very slow, what can i do about that? [closed]
- How to host a WordPress plugin on my own server and provide updates?
- register_activation_hook not working
- Predefine Product Variations for specific custom product type [closed]
- Vanilla javascript in custom gutenberg block not working
- How to use `$order->get_discount_total()`, avoiding defoult WC decimal rounding?
- View Version Details” on Plugin update shows “Plugin not found