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
- Who are the most trusted plugin developers? [closed]
- Get plugin_dir_url() from one level deep within plugin
- Redirect to settings page after install
- What is the correct way for a theme to support plugin UIs?
- How does WordPress determine the primary plugin PHP file?
- flush_rewrite_rules() not working on plugin activation
- Plugin Functionality Only for Editor and Administrator
- Plugin to hide admin menu (vertical menu bar)
- Having separate plugins and themes folder for multi-site setup
- Do you clean up your self-written plugins’ at deactivation?
- How do I turn a custom post type into a plugin?
- How to remove xmlns on language_attributes()?
- Add keywords meta to index.php page
- Does WP identify plugin by plugin name or plugin_basename?
- Modifying Author Link to add Author Meta in URL
- Force file download on plugin activation
- How to disable a plugin for certain page?
- How to create a custom post type that contains another custom post type?
- Template filter for custom taxonomy terms
- Add action to fire when a published post is updated
- How to make multiple admin pages for one plugin?
- Create custom pages with a plugin
- Is it possible for a plugin to force reading and writing of uploaded images to a database instead of to a filesystem?
- Amazon.com intergration with WordPress?
- Minimize and Uglify WordPress Plugin Files
- Can I filter a function created by a theme or a plugin?
- Comment “like” problem – “users who like this” avatar linking to current user profile instead of “liker’s” profile
- I want to generate the pdf and save it in library?
- How do I make sure that my plugin only runs on article detail pages?
- How to Use the Filter “sidebar_login_widget_form_args”
- How can i listing current category and Featured Category post list?
- Ajax request sends url rather than data
- Edit post image attributes on fly?
- How to displaying Custom image, text and default image logo from Redux Framework option panel
- Grouping imported products and showing variations based on selected product
- save_post_product action not firing
- How to display the category name in the tab and post inside the tab in WordPress?
- How would I Redirect an existing WooCommerce customer to a specific url after Checkout
- Has blocks gutenberg block multiples registers type in my Plugin
- Ultimate Members Default Post Layout problem
- best way to upload a large file to wordpress using wp all import
- Why do actions with class and public method don’t fire __construct()
- How to define the slug for my custom plugin?
- Custom plugin settings page with tab. Error: “Sorry, you are not allowed to access this page.”
- How to add a box note in wordpress plugin page ? top header side.
- Help needed with woocommerce (wc stripe) filter
- Widget outputs the value but doesn’t save anything inside the textarea
- Why some plugins are including wp-includes/plugin.php file?
- Redirect default login page to a custom page [duplicate]
- Display_rows() and column_cb() strange behaviour
- WordPress plugin options need to delete after deactivate & uninstall
- How can I pass value to function in add_menu_page?
- How to generate a responsive output from plugin?
- The plugin generated xxx characters of unexpected output during activation
- How to hide a piece of code from a wordpress web page?
- How to dispaly post informations (such as titles) in an admin plugin menu page?
- How can I make my plugin detect if a certain theme is active?
- Pulsing circle before the post title (Breaking news flash)