From your post what i understood is u need to show images saved in your plugin folder.if yes then you can go with plugin_url to link images in a plugin directoy without specifying the plugin folder name.
Example:
<?php
echo '<img src="' . plugins_url('/images/header-background.png', __FILE__) . '" > ';
?>
The ouput will be like
<img src="http://www.example.com/wp-content/plugins/my-plugin/images/header-background.png">.
If you are using the plugins_url() function in a file that is nested inside a subdirectory of your plugin directory, you should use like this:
<?php
echo '<img src="' . plugins_url( 'images/header-background.png' , dirname(__FILE__) ) . '" > ';
?>
If you want to know more about plugin_url() refer here
Related Posts:
- Flickr plugin that will display photos from multiple group pools? [closed]
- Is there a Image Gallery which will load all my posted Images like twitter’s image grid?
- Conditionally enqueue a widget’s script/stylesheet in HEAD (only when present on page!)
- How to custom crop each image size?
- Is it possible to “freeze” a WordPress blog?
- Using Advanced Custom Fields with WordPress and Lightbox
- Display (and manage) webcam images?
- Cropping, Re-sizing and Saving images from one folder to another folder in wordpress
- How to make WordPress use protocol indepentent upload files?
- Delete Custom Dashboard Widgets
- How to pass JavaScript variable to PHP in wordpress widget?
- How To Add an Extra Field in All WordPress Available Widgets?
- Using the media uploader in a custom plugin
- Has anyone been able to get the aweber plugin to work
- How to create a widget or plugin to add custom content to my website?
- How do I change the description of the same image which is to be found in multiple instances?
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- Use Media Uploader in Plugin
- How can I retrieve data within my widget
- How to unregister a widget from a child theme
- How to exclude a widget from page 1 of a paginated post
- Get uploaded image url
- How to change Thumbnail size of next Gen Gallery plugin?
- how can i limit the number of instances for my widget
- Dashboard Widget Form
- How to remove the whitespace in image name and save the new file
- Can I use a form in a dashboard widget?
- Is it possible to insert images directly from the server?
- Advanced Custom Fields
- The called constructor method for WP_Widget in GFWidget is deprecated since version 4.3.0! Use
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- I wrote my plugin. How to display the result of the plugin’s function to sidebar (widget?)?
- How to check if you are on widget.php page?
- How to add an image from web-link?
- Theme’s default styles are overriding my plugin’s custom CSS
- Adding widgets to header and footer from plugin
- Rotate Widgets or Content Blocks every x sec/min
- Show an image in my header.php
- Do widget options need to be escaped widget()?
- Ajax contact form widget plugin data not insert in database
- Force media library editor to overwrite the original filename?
- Bulk edit WP posts to update embeded images with new alt tags
- Which widget to use for display category post with view more? [closed]
- Wysiwyg editor errors
- How to get my plug-in, wrote in php, to refresh on its own every 5 minutes?
- Conditional tag in Widget Logic for checking if top level page or if subpage
- Make change in media library affect images in published articles
- Char limit on custom blog-post form? [closed]
- Bulk Image Upload And Rerrange Functionality
- How to add Wrapper Div/container element around WordPress Widget Content
- Plugin to hide image in excerpt
- Image change on hover
- How to write “alt” tag in image for wordpress code?
- How do I get a post author’s image/avatar via RSS from another blog?
- Saving widget options from class method
- How to handle forms from sidebar widgets – Processing $_POST variables using get_field_name()
- Short messages widget [closed]
- Plugin that will let me specify a number of image sizes?
- Clear out old images, any advice?
- Large amount image data transfer
- Get Image Having the ID [closed]
- Scrape a webpage for image and add it to post
- How do I link an image in my plugin so it displays on WordPress?
- How to display a widget on a page with no theme?
- Widget where it can make changes to the container
- Add_image_size not generating correct size
- Widget content turns up before title
- Is there a way to insert multiple images into a post at the same time without using a gallery?
- Modify pages widget and make a plugin?
- I’m having several WP issues, especially with missing images
- wp_footer hook running twice
- co-authors plugin – inline listing
- How can I display selected content from a seperate database in an Activity style widget?
- Enlarge an image slider when click
- Get all image in media Gallery with alt/title?
- RSS Feed on WordPress showing code (hypertext) in articles titles
- Change language in SiteOrigin Widgets
- Do images in plugins automatically load?
- Some Widgets in the Right Side Bar and the whole Footer section is not working in a WordPress Site
- Using foreach loop for `$instance` of form and update array widget iteration
- WP_get_image_editor resizing images in a foreach loop
- WordPress create thumbnails on demand
- Shortcode generated widget to appear on same line as heading text and button
- How to make cover image in post block expand to entire screen?
- How do I keep children of certain parent menus expanded by default on a sidebar?
- Widget logic using woocommerce product category
- Images not showing on homepage after migration [duplicate]
- Widget Script Loads at Bottom of Page
- Use of apply_filter in plugin/widget class
- Determine if get_the_image has image on Get the image Plugin
- Retrieve post thumbnails
- Widget redirecting to home page
- How to make plugin work in each template in wordpress
- How to use template field in the Event Organiser plugin widget
- how to add “alt” for all image in wordpress
- How should I force WordPress to give proper name for the uploading images?
- Woocommerce resize existing product images
- Issue with customizer and widget page
- Footer option is missing in Customiser
- Why my widget is not visible in the WordPress theme Twenty Twenty-Three