I found a nice snippet at this site for your functions.php
that does the trick:
add_shortcode( 'gallery', 'file_gallery_shortcode' );
function file_gallery_shortcode( $atts ) {
$atts['link'] = 'file';
return gallery_shortcode( $atts );
}
I’d actually been looking unsuccessfully for the same thing, so I’m glad you asked.
Related Posts:
- media_handle_upload for local files?
- How do I detach images from posts?
- Easy way to delete 70k posts and attached media?
- Automatically attach image to post if they have the same title
- Bulk Attach Or Insert Media To Post Without Opening Post Editor
- Broken images after importing posts and opening in Gutenberg
- Turn a URL into an Attachment / Post ID
- ZIP up all images displayed in a [gallery] and offer as download link
- Delete Associated Media Upon Page Deletion
- Delete post with all files attached to it
- Is it possible to Schedule Attachments in WordPress?
- How can you change the ‘Insert into Post’ title in the media button?
- what types of order can I pass to get_posts() via orderby?
- Find the post an attachment is attached to
- Use an attachment in multiple posts
- delete post also attachments
- Get post id by attachment id?
- How can I export WordPress posts’ attachments?
- How to remove images from showing in a post with the_content()?
- upload featured image from front end using wordpress add media button
- How do I create Comma Separated list of attached image ids?
- Get post embedded image caption
- Limit amount of results returned
- post_parent is 0 when uploading new files
- How to access featured image?
- Load post attached images on a single page site with fancybox
- Too many connections to server
- Errors when uploading images in WP 3.5
- Insert woocommerce products programmatically with featured image and gallery
- Add the description field on the attached media
- How can I get the media inside a post?
- Set size for attachments
- I have a site where attachments in the wp_posts table have guid values of guid, how did this happen?
- Get all attachment by post excluding featured and content inside
- Prevent Delete Attachment by URL or When Submit
- wp-cli post create & media import issues
- Posts and Attachments with “Published” status in Search
- Get attachments for posts that belongs to a specific category
- Removal of Media Gallery pictures
- How can you change all past posts’ images to link to none instead of the image file?
- Get Image tag from content of post
- How to get the last selected media alignment setting?
- Can’t update old posts 3.5.2
- WordPress Automatic Filename Changer
- How would one change the default url structure of attachments?
- Returning data instead of echoing/printing
- Remove Featured Image & All Media Uploaded to the Post
- Get attachments only for this post
- Upload attachment from external site
- Reinstall WordPress while keeping attachments
- Display a mixed list of posts and media
- How to get all inline images in post content? [duplicate]
- Get images from the post
- Inserting Media to WordPress Posts
- How To Download WordPress Audio Attachments
- How to get the next and previous image title from attachment or gallery?
- All images on one line for each post
- Delete Post but retain image of post [WP REST API]
- Site/Post preview is not working on all social media
- unable to write to the database while uploading images
- How do I assign an attachment to a post using only the REST API?
- Getting image data from phone camera (MediaDevices.getUserMedia) into user post
- Unable to delete attached file from folder programmatically
- How to convert attachment pages to Posts?
- Get post attachment with post id
- Post images are not displayed in media library
- Delete attached images from posts
- Unable to get all the Posts Attachments
- Connection dropped due to file size
- Add in the url attachment loop the wp_link_pages of the post
- Get posts associated with media attachment
- Customizing individual images on posts
- Embed button for post screen
- Stop images from being displayed on the front-end of the site
- Disable Media uploader to users
- How to get images only attached from edit post page
- How to get only current images of a post
- How to associate media with a post?
- WordPress Media URLs?
- How to prevent people from seeing an attachment to a scheduled post that’s released in future?
- How can I get a comment ID on Submit?
- How to add audio media in a post?
- How would I attach media/images to a post based on a ID stored in a each post’s custom field
- Post Attachment missing head (stylesheets/js/what-not)
- Create post from form with image
- How can to use the players from the Media Widgets in the body of a post to play audio and video files
- Get Video Attachment to post
- how to edit attachments?
- Bug with post titles [closed]
- Inserting Media on New Post But Hides Previous Uploads for Editor/Contributor
- What is the proper use of guid for images in wp_posts?
- Optimize blog that serves hundred of images and videos
- Convert custom fields to post categories
- Odd/even class on article tag
- How to get posts by multiple post slugs? [duplicate]
- WordPress posts have a different URL to the index
- WordPress each user has each content for a page,how to do that?
- Send/Publish a Post front end
- WordPress sub-posts and permalinks
- Show List of Posts With Comments Open