I can think of a couple of options:
-
Create a new shortcode, e.g. my_gallery. You can copy the code in
wp-includes/media.php
. Look for the code staring with
add_shortcode('gallery', 'gallery_shortcode');
and then the actual
function. Rename / modify as needed. The actual img link is within
the$link
variable -
Use something like this (untested), which should work but might
strip-out all width/height from any link.
_
add_filter('wp_get_attachment_link', 'remove_img_width_height', 10, 1);
function remove_img_width_height($html) {
$html = preg_replace( '/(width|height)=\"\d*\"\s/', "", $html );
return $html;
}
Related Posts:
- Automatically add this attribute to the gallery shortcode
- Remove width and height attributes from [gallery] output
- Replace custom gallery shortcode with default gallery shortcode
- Conditionally Loading JavaScript/CSS for Shortcodes
- Pass boolean value in shortcode
- Check if post/page has gallery?
- Escaping quotes from shortcode attributes
- how to have the gallery shortcode output one single UL list instead of several DL?
- Allowing for multiple template views on the Gallery Settings page when using the Visual Editor
- How to add ‘class’ attribute into shortcode [audio]?
- Customizing gallery shortcode in 3.5
- How to handle valueless attributes in shortcodes?
- Get multiple shortcode attribute values
- wpautop() when shortcode attributes are on new lines break args array
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- WordPress gallery ‘post_gallery’ filter doesn’t work with feeds?
- conditional shortcode not working
- Add attribute to existing Shortcode
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- conditional shortcode not working
- Some doubts about gallery shortcode in WordPress
- Shortcode displays only default attribute values
- Extending Shortcode attributes
- Remove HTML content if attribute is not set / variable attributes
- Global, network-wide shortcodes or text replace functions
- getting values from a shortcode with an include
- Should I cache default WordPress gallery shortcode output?
- Numbering Image List in Gallery
- Rewriting WordPress Gallery Shortcode with Bootstrap Carousel
- change wordpress gallery shortcode to slider
- Why are Shortcodes Disabled in Widgets by Default?
- Add attribute to shortcode dynamically
- Remove hyperlink on gallery shortcode
- Add custom setting that uses radio button to WP Gallery
- Replace / Remove Shortcode after 1st run / post
- WordPress Gallery shortcode: Display one category ID only
- How to get gallery id inserted to a post?
- Check if post has gallery images/media
- Caption shortcodes not including caption as attribute
- Gallery IDS and Captions: hide/show on a per ID basis
- How to Modify WordPress Default Image Gallery Shortcode
- Change WordPress Shortcode added in to post
- Gallery shortcode – change link file image size? (not using default fullsize image)
- add action only if gallery shortcode attribute is equal to?
- Unable to the get the gallery inserted between shortcodes
- Conditionally Loading JavaScript/CSS for Shortcodes
- Adding shortcode field to edit gallery / Gallery Settings
- How to change the output of gallery shortcode
- Replacement for gallery_shortcode function not taking all attributes
- Check if CTP category taxonomy is set in shortcode
- Passing variable in nested shortcodes
- How to use a nested shortcode to render the value of an attribute in parent shortcode
- Which wordpress function is the caption shortcode linked to?
- How to Retrieve data of Gallery Shortcode and display it above a post
- How to copy [gallery] shortcode between posts using polylang [closed]
- Which file renders the “Edit Gallery” Settings page?
- How to display NextGEN gallery in templates?
- Use full size images in a specific gallery
- How to Enable embedding WordPress default gallery in comments?
- How to add new images to existing shortcode configuration?
- Gallery shortcode is empty but magically creates a gallery
- Can we add a single caption to the gallery shortcode?
- How to process a single attribute in a SQL request twice times?
- shortcode atts not working
- Second attribute of shortcode is not changing why?
- Automatically add class-attribute to gallery?
- Shortcode Attribute contains clone of all shortcode attributes
- WordPress Gallery with ID’s Shortcode not Working
- How can I define the output of shortcode attribute value?
- Changing layout of defaul gallery output to masonry
- What makes a placeholder resizable in Tinymce?
- how to show last 5 images from the one post gallery
- Gallery Shortcode: using size=”full” doesn’t call the actual thumbnail image size
- Making a Shortcode [NEXT] and [PREVIOUS] to place into specific posts for post navigation
- How to display the site name in a WordPress page, or post
- Is shortcode_unautop() broken?
- How can I make a shortcode from this code?
- Adding PHP/HTML code inside page from custom template
- Shortcodes Keep Wrapping in
- Populate shortcodes with table data and get next row
- Running shortcode with variable that is modified
- How to apply an ID to Shortcode Embedded iframe
- Using $this from child class inside shortcode function
- How to trace shortcode to its functionality
- shortcode issue in the_excerpt
- If else with shortcodes
- Using shortcodes to communicate my page design
- gallery shortcode exclude not working
- Customizing the gallery of the post correctly
- my form does not insert any data in the database
- Can Someone Help me to Correct my shortcode for displaying a category?
- Simulate shortcodes with javascript
- How to use Shortcode from one WordPress page in another WordPress page?
- WordPress Server Time not changing/displaying correctly
- Trying to echo out custom field inside shortcode?
- woocommerce Product shortcode create [closed]
- Why is my ajax live search not working when i use a shortcode to call it?
- My first WordPress shortcode just returning []
- WordPress shortcode select option not working [closed]
- How to use multiple values in “Shortcode”? [closed]