By default a user can save any image by right clicking on it in their browser and selecting “Save Image…” or similar.
HTML5 offers a download
attribute to the <a>
element that will attempt to force the browser to download the image. So your resulting HTML would look like this:
<a href="https://wordpress.stackexchange.com/questions/293568/{{ url of image }}" download>
<img src="https://wordpress.stackexchange.com/questions/293568/{{ url of image }}" alt="Alternate Description for Assistive Technologies" width="700" height="320">
</a>
Additionally, the download
attribute can take a file name too so download
becomes download="SaveFileName.jpg"
Without knowing more about how you want to do this, I cannot offer up any WordPress code.
Related Posts:
- Custom plugin: Trying to show saved data on frontend
- Is there a browser plugin or method to find which php template an item is coming from?
- Display message once per session to users with a specific role
- How to correct schedule my event weekly with wp_schedule_event()
- get_the_content if it contains multiple lines it results in SyntaxError
- How can I add a class to a single menu item?
- WordPress returns a wrong date
- How to enlarge the media file upload size in wordpress admin
- How do I hardcode a WordPress shortcode into my theme?
- WPDB: how to get the value of a field in a custom database table
- Debugging PHP object during Ajax call in WordPress
- How to exclude specific category from the get_the_category(); array
- Memory errors with media upload, WordPress can’t use more than 96M (while there’s 512 available!)
- WordPress override bloginfo variable
- How do I display a user’s previous orders as a select box option on a product?
- Hide wordpress field if data is empty in post!
- Show MySQL errors that occur when I excute $wpdb->insert()
- Echo a hierarchical list of post data from custom fields
- The text box have space character
- Editing Category RSS Feeds
- 3 blogs same installation, without WP MU
- get_avatar won’t show uploaded avatar, only default gravatar
- How to combine wordpress_logged_in cookies in one cookie?
- Automated Cart Update With Alert Box Each Time
- Need help with Google drive API [closed]
- How to show all pages in blog navigation?
- How to insert data into database using wp cron job
- WordPress admin is incredibly slow [closed]
- Archive post by meta value + 24hours
- Different post styles depending on category
- Setting value of session with Ajax not working
- Click a radio button must set textfield value
- Configure Php server with ISAP
- How Can I use WP_Query to Only Display 1 Post from Custom Post Type if Query Returns Posts with Matching ID in Custom Field
- Large Woocommerce Site (83,000 items), What Can I Do? [closed]
- Shortcode to show the code
- db converts decimal number wrong
- How do I find PHP file that contains content of my page?
- How to keep empty fields from appearing in php?
- Multiple do_shortcode in page template
- Include Parent Term in wp_list_categories
- is_user_logged_in() not working in AJAX validation call
- How to add text to the start of all comments?
- If else statement to check for thumbnail and whether or not it’s a mobile device – streamline
- How can I automatically resize up images to fit into all of my registered image sizes
- How can I use a sliced image As banner? [closed]
- Compare $_POST returned values with term array
- Correct PHP to output a single result of a Function with SQL Query
- Broken kses.php function “wp_kses_named_entities” crashes WordPress
- Understanding webhooks
- if custom field doesn’t exist, use post thumbnail instead, as image background
- Display child page content of a specific parent on home page
- How to add 3 weeks to the_time() function
- wp nav menu: show submenu below li item
- Show label for value only when value exists, basic php
- WordPress Custom Query: Combining Two Functions
- Counting number of posts in multiple (sub)categories using shortcode
- Display WordPress search results based on the selected Sub-Category
- Reject all malicious URL requests functions.php
- Using some Loop or repeatable fucntion in AJAX and PHP to reduce repeatability
- How do I call a value from the datase using ajax
- Woocommerce disable order item link (backend) [closed]
- Where to add my PHP codes for AJAX Jquery to work?
- Display the list of user’s comments + the post title + date
- Adding ELSE argument to AJAX Live Search for “No results found”
- Is it possible to change the get_posts() or wp_query() function to alter the results that are returned?
- How to optimize and reduce excessive database queries
- Comparison operator != not working in field [closed]
- Notice: Undefined variable
- Add the shortcodes from the enfold theme to the other theme
- PHP 7.2.18 | Your PHP installation appears to be missing the MySQL extension which is required by WordPress
- How can i style “echo apply_filters”
- get_category_parents to array
- How to properly create multiple conditions to redirect users roles to different pages
- unable to add category in creating post dynamically
- making a search.php query
- Splitting table data to pages with numbers
- How do I generate formatted permalinks as specified in backend options?
- Upload images from one server to an other in wordpress
- Ajax not updating to database
- Custom YouTube Plugin loading different PHP library on live site and localhost
- Issue in url update when using wordpress update query
- Widget edit and add in any page
- How to use Amazon Elastic Transcoder from WordPress using AWS SDK for PHP?
- Headers Already Sent
- Sum of Custom Meta written by Authour
- Active class not working on custom menu link using add_menu_page
- If or/and statement advanced custom fields [closed]
- Remove duplicates from foreach
- Show items by user_role
- Determine if only one image attached to a post/page
- link to page_for_posts
- get_avatar from user id
- wp_mail vs mail functions and header arrays
- WordPress get_the_term_list include class name for heirachy
- WooCommerce – Show ‘Sales’ badge on variable products where only some variations have sales price [closed]
- How can I change the URL via add_rewrite_rule()
- Variable ++ in query loop
- Generate and upload screenshot as featured image for user-submitted post
- How can precision be improved for the debug log timestamp?