You’ve got a path problem. When the plugin executes, any reference to a file is relative to the plugin folder.
Use developer tools (like Firebug) to see the actual request for the jpg file. You’ll see that it is trying to find the jpg file in the plugin folder. Adjust the path to the files.
Take a look at the get_template_directory_uri() function to help you get the proper path for your images. See https://developer.wordpress.org/reference/functions/get_template_directory_uri/ .
Related Posts:
- Image upload via FTP to wordpress media library
- Add htaccess rules with insert_with_markers at beginning of htaccess
- How to restrict wp generate attachment metadata() to certain intermediate image sizes
- How to upload a file to a folder named after the user_id via plugin
- Can’t upload image using media_sideload_image
- Redirect to another page using contact form 7? [closed]
- zip unzip attachments in wordpress
- Can’t upload CSV file to plugin directory using custom upload form in admin panel
- custom plugin with upload files does not work
- Problem with inserting multiple images in gallery of each WooCommerce product programmatically
- How to automatically convert images to WebP on WordPress?
- How to save WordPress post and attachment images from front end using media library?
- Upload Image in a WordPress page using PHP
- WordPress php filter admin_body_class not working
- WordPress (3.9.1) MultiSite Permissions. Is chown the answer?
- Instantiate class to be available to all plugin functions
- Common abstract class for plugins
- Cannot get media type from ‘x-mapp-php5’
- How do the pros code up a WordPress theme? Locally? Through FTP?
- How to test nonce with AJAX – Plugin development
- What does $wpdb->get_row return?
- Randomise upload filenames (or another solution to hide the original image URL from theft?)
- Using file_get_contents with Gravity Forms uploads folder to create images in the media library returning false
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- WP add_action factory
- wp_loaded hook block script enquequing
- how to retrieve uploaded url of zip files
- WP nonce invalid
- woocommerce subscriptions – get expiration date [closed]
- Same log message keeps on printing to debug.log file thousand of times
- Why is $_REQUEST an empty array in admin-ajax.php?
- Adding Default Settings to Theme My Login plugin
- Custom filter in admin edit custom post type responding with invalid post type?
- WordPress Scheduled Event Request Blocking
- How can i upload images in an admin page?
- Append HTML Using Shortcode
- Delete a WordPress transient from a shortcode on Page/Post update
- Plugin CSS not enqueing
- Create onClick Event to Re-load a Widget
- Swapping wp_dropdown_categories function with wp_category_checklist
- Accessing the database from a plugin outside of action hooks
- Adding subdomain to home_url for “add_menu_page”
- How to show phpinfo() only in a new tab?
- How to find error in my code when the error message is pointing to WP core file?
- How to select the contents in the text view textrea in wp_editor?
- How to change home or site url using action hooks or filter?
- How to access global variable $menu inside a class function
- Apache Fallback instead of add_rewrite_rule
- 3 blogs same installation, without WP MU
- Must I download entire WP directory for each separate instance/website that uses WP?
- Hide categories that are not used in the post type
- Automated Cart Update With Alert Box Each Time
- How can I remove a function that has been added to wordpress with add_filter?
- Two Different Links for Same Product – WooCommerce [closed]
- PHP Fatal error: Uncaught mysqli_sql_exception: Table doesn’t exist in wordpress/wp-includes/wp-db.php
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- How to sanitize any integer input field in wordpress?
- How to set up VS Code for WP plugin/theme development in 2021? [closed]
- PDF file randomly breaks upon upload
- WordPress ajax doesn’t display object method on jQuery .change() function
- Was told to change the .htacess file form .html to .php so this would work properly
- Custom user login page by creating a plugin
- Singelton class does not work, multiple initialization on page reload
- Saving an array of dynamic repeater data as post_meta
- what is the best practice to add new field to an api route
- filter default query to show just selected level of child pages in wordpress
- Retrieve $_POST data submitted from external URL in WordPress(NOT API)
- WordPress wpform plugin submit and get multiple checked value from checkbox [closed]
- Image upload via FormData API and AJAX is not working ($_FILES always empty)
- Reprinting tags with all attributes
- Use custom post type for a store locator
- developing a wordpress plugin, have a few PHP Woocommerce related coding questions
- Need help with Google drive API [closed]
- Improve page speed loading using CDN and async or defer attribute
- How do I programmatically set a user as spam in BuddyPress? [closed]
- How to change redirection route to a php page for making it only accessible by logged-in members?
- How to use $_GET function WordPress backend
- Whitelisting items from custom options page
- Add_menu_page not displaying the menu in class based plugin
- How to call plugin function per site in a multisite?
- Update results, Before deleting the related category [closed]
- How to make my custom widget appear within WordPress widgets? Plugin development
- Script to browser problem PHP
- adjust section according to country?
- How to auto fetch customer details in Woocommerce in checkout page
- how to combine wordpress htaccess on my root domain + php on subfolder
- Store a default value for a transient on plugin activation
- Adding widgets to my plugin page instead of WordPress dashboard
- WP CRON duplicate wp_insert_post with has < and > tag
- How wp-cron can run in background if PHP is single threaded?
- How to insert data into database using wp cron job
- How to send Ajax request from my plugin in admin dashboard?
- subdirectory index.php is not working
- custom url rewrite for wordpress
- Upload multiple images to a Woocomerce product
- I want to add custom add to cart link [closed]
- Options API get_option() and update_option() Not Correctly Updating or Returning
- Execute long and heavy processes
- wp_head function not outputting
- wp query foreach deleting record returning only first or last item