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
- Any hook for pre-plugin-update -either bulk or single plugin update
- Is there an earlier hook than login_head or login_enqueue_scripts?
- Add custom message to the plugins page of WordPress
- How can I implement an Add to Collection function on my Image Gallery to be downloaded later?
- Gravity Forms plugin: How to use “gform_editor_js” action hook? [closed]
- How to Delete all Unused photos Function
- How to resize images due to container width automatically server side/without CSS
- Inserting above the comment template
- Insert new user with form submit ‘init’ hook
- Set featured image randomly from WordPress Database on post submission
- How do I display only the latest post on my home page, while maintaining proper plugin hooks?
- Howto accurately position images with maximum flexibility?
- Show an image in my header.php
- Hooking in to replace the Sidebar/Widget areas
- List Category Posts rewrite necessitates rewrite of customised templates
- How to create a managed image repository in wordpress
- How to get all of the activate_plugin action parameters?
- Modifying the comments section through a plugin regardless of theme
- How to stop activating a plugin and show admin notice when dependent plugins minimum version is not met
- Using a post-signup hook to get user details
- Map a custom id to wordpress post id
- WordPress comments not appearing in blog posts, likely because of Redux template. Could I fix this with a plugin that adds a comment form as a block? [closed]
- woocommerce_package_rates not fired when wordpress woocommerce accessed as non ajax
- Trigger Elementor Popup via code [closed]
- wp_get_post_terms is difference obj model than the one in rest api response
- How can I restrict image upload dimensions for non-admin WordPress users?
- Calling plugin function inside custom plugin for onclick event
- (FES EDD) New vendor submission page is blank
- Plugin-generated pages use Not Found or Pages Archive templates?
- get current date + 90 days and checking every day
- wp_generate_attachment_metadata is creating an empty array
- Calculate price and display on woocommerce product single page under price (simple price, variable price) [closed]
- Force media library editor to overwrite the original filename?
- How to display (plugin?) output on a single page (not a widget, probably not a short code) – template, plugin, combination?
- Get Time Taken By Each Action Hook in WordPress
- Facebook Messager Plugin
- Contact Form 7 Get Image Function [closed]
- How generate 200% image size and save with suffix @2x
- Load external images via proxy
- Are functions in main plugin file called before function bound to register_activation_hook runs?
- Filtering WooCommerce Orders by Category
- Advanced Custom Field DatePicker [closed]
- Best place for short bio,image and button [closed]
- Bulk edit WP posts to update embeded images with new alt tags
- Use of Templates in a Plugin
- Add comments for template variables
- How to upload WordPress Images to remote web server and display those images in WordPress gallery [closed]
- Add padding while generating thumbnail
- do_action() hook into load-(page)
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Render custom php template into string
- Perform internal redirect in WordPress?
- Howto check version of another plugin and then add a submenu page to it
- How WordPress is able to change locale without using setlocale
- Retrieving Meta from Image Attachment
- password_reset hook is not working
- The Hook registration_errors was not called
- Add ALT attribute to Pin It Button image to pass HTML5 validation
- Make change in media library affect images in published articles
- Hook into existing tinyMCE button
- Adding (image) caching to my Tumblr widget
- How to upload multiple files/images when developing a wordpress plugin?
- Image Manager Plugin [closed]
- Implementing an image hosting website using WordPress? [closed]
- How to get post ID with hooks publish_post, new_to_publish, etc
- Is there any hook for theme activation ? or something similar?
- How to use get_template part in the plugin?
- Bulk Image Upload And Rerrange Functionality
- Redirect to another page using contact form 7? [closed]
- changing posts layout in ultimate member profile plugin
- edit_user_profile and show_user_profile are not firing inside a class
- How to apply lazy loading in background images [closed]
- how to force tag page layout to use same as search layout?
- Add sub menu page in your plugin
- how to change automatic placing of social plugins below content?
- Include WooCommerce 2’s prettyphoto scripts on all site pages
- How can I use a file in my plugin as a replacement for single.php on custom-post-type query?
- Woocommerce showing images blurry in description page
- Slider/text combination plugin
- Plugin to hide image in excerpt
- Calling the_excerpt from inside a plugin template file
- Best practice for including plugin output in a template without using shortcode?
- Timber – Twig post.content returns null can’t create ACF Gutenberg blocks
- What exactly happens to function argument availability when using a filter?
- Combining several CSS files into one for optimization
- the_post hook is not firing for me
- Image change on hover
- Why do plugins often ask to add in to templates?
- Deactivate JS Script in Plugin Shortcode
- How to write “alt” tag in image for wordpress code?
- Adding Static Image to WooCommerce Content-Single-Product template
- Where to find the code used to render a page that has a shortcode and a template defined?
- How do I get a post author’s image/avatar via RSS from another blog?
- Create a post builder skin in a plugin
- remove_action not removing add_action from constructor
- Plugin Development – Functions or Hooks?
- How do I override plugin templates and stylesheets?