You would have to put your code in your question into a function. Maybe something like function wpse_91897_get_image() { }
. Then try the code below. I haven’t tested this but it should work.
function wpse_91897_display($content) {
global $single;
$output = wpse_91897_get_image();
if (is_single()) {
return $content . $output;
} else {
return $content;
}
}
Then you would add a filter to call the functions for the content.
add_filter('the_content', 'wpse_91897_display');
Then add some CSS to position and style it. It will show up under the content on your post.
Related Posts:
- Template filter for custom taxonomy terms
- Prevent plug-in scripts on a specific template?
- Customize plugin templates
- How can I edit post data before it is saved?
- Registering Class methods as hook callbacks
- How to customize woocommerce related products? [closed]
- Pass PHP variable to javascript
- Is it possible to stop selected plugins from loading on certain template pages?
- How to add a new product type on woocommerce product types? [closed]
- How to Delete All regenerated thumbnails but keep the original ones?
- How to upload image with simple form?
- Edit plugin without hooks in functions.php
- How can I log a user out of WordPress before the page loads?
- Seeking clarification on page request life-cycle
- Pass A Value From Outside To A Plugin Variable
- Built in admin ajax hooks?
- Template plugin for blog posts? [closed]
- resize only height using wp_get_image_editor
- How do I make a wordpress plugin with menu item etc
- Layout shop page: resize images and columns
- How to crop image from center using wp_image_editor
- How to find out what blocks are added by a plugin
- Get image URL from media library in input
- taxonomy_template filter do not loads custom taxonomy template properly
- How to remove the whitespace in image name and save the new file
- what the hook for displaying course list page for learndash plugin? [closed]
- Converting Attachment to Images?
- Bulk Image Uploader to create new post from each image [closed]
- What are the benefit in adding hook in the init() hook?
- How to add a random image to a post from gallery and only show one?
- Where to hook my plugin’s action
- More than one text-domain is being used because of the included templates for plugins
- How do action and filter hooks understand where to look for the core function that we hooked our function to them
- How to add an image from web-link?
- WP Post Template – Templates in own folder
- Add custom message to the plugins page of WordPress
- Set featured image randomly from WordPress Database on post submission
- Hooking in to replace the Sidebar/Widget areas
- How to get all of the activate_plugin action parameters?
- Force media library editor to overwrite the original filename?
- Add comments for template variables
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- How to upload multiple files/images when developing a wordpress plugin?
- How to use get_template part in the plugin?
- Bulk Image Upload And Rerrange Functionality
- Include WooCommerce 2’s prettyphoto scripts on all site pages
- Best practice for including plugin output in a template without using shortcode?
- Why do plugins often ask to add in to templates?
- How to get menu location in wp_update_nav_menu hook
- Getting taxonomy images to display on single-post with their terms
- Default taxonomy template in plugin, override in theme
- Image crop, resize and compression plugin?
- Plugin that will let me specify a number of image sizes?
- Save user total active time after login in wordpress [closed]
- Advanced WordPress plugin activation detection
- wp_loaded with static Singleton
- How to return the values from a row where a value occurs for the first time among the rows available?
- Get Image Having the ID [closed]
- Pagination shows Same posts
- How to hook into action/filter call
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- How to automatically activate users after registration without activation email?
- Adding custom Field To The Posts Listing
- Pass PHP variable to javascript
- Add hook after content without formatting
- Using Remove Action Hook in Plugin
- admin_post hook not firing function inside class
- Get all image in media Gallery with alt/title?
- Is there a way to auto generate poster image for videos
- Hide WordPress Site URL from Source Code
- How to add post title to custom php?
- How to access Post Archive created by Elementor?
- Programmatically generate new pages for a site based on page template and content elements accessed via DB
- Edit plugin’s HTML output with Hooks
- Display Woocommerce attribute name above product title
- Remove special characters from filenames
- Looking for Image Slider that is based on default WP Media Library
- How to change the deafult template in WordPress plugin
- {status}_{post_type} does not run correctly?
- flip horizontal images in bulk
- How to Display image from Menu Image in Walker Dropdown Select Menu
- Add a filter to a method in the parent theme
- Run only on plug-in activation instead of wp_head
- WordPress hook source
- Function the_content
- How to `remove_action` from plugin
- export high ress images to pdf
- Any way to edit/crop my featured image upon uploading?
- functions.php conditional output for a single plugin
- show Visual form builder in the front end
- Fake Single WordPress Post (Page) Loop
- Make a wordpress site similar to Hot Or Not – Image rating system [closed]
- OOP Plugin: Where should I place the action hooks in the class?
- [Custom field template plugin] Upload limited to 20 inputs file
- Displaying single Instagram images as a tile
- WordPress show different custom post type
- Woocommerce resize existing product images
- How to Add Extra Text In WordPress Title Before Post Publish
- How to show image caption in Woocommerce gallery
- Why is my activator class adding the files/running the actions I add?