add_filter( 'wp_get_attachment_link', 'sant_prettyadd', 10, 6);
function sant_prettyadd ($content, $id, $size, $permalink, $icon, $text) {
if ($permalink) {
return $content;
}
$content = preg_replace("/<a/","<a rel=\"prettyPhoto[slides]\"",$content,1);
return $content;
}
Update:
function sant_prettyadd checks permalink argument.
if the permalink = true
then it returns the content as it is.
if the permalink = false
then it skips to the next line and replace the <a
with <a rel="prettyPhoto[slides]"
and then returns the content.
Related Posts:
- How to remove title attribute from gallery links and images
- Exclude images from “inserted into post” when trying to get attachments
- Customizing the attachement page to show rest of all images in a gallery from post
- One picture belonging different galleries?
- Excluding post thumbnail from the attachment.php when using wordpress gallery
- Can i have 2 separate Galleries on 2 separate pages each go to a DIFFERENT Attachment.php file?
- attachment.php & flexslider—linking thumbnail to specific image
- Image Attachments Query Not Working If Post Is Loaded Via Ajax
- Programmatically adding images to media library
- how to get original image using wp_get_attachment_image_src
- Uploaded images don’t show in Media Library if there are special characters in IPTC Keywords
- How to have different captions for same image, for galleries?
- How to find attachment by it’s name?
- WP 3.5 and Galleries – how to count images?
- Cropped featured image replaces original image in gallery
- How do I delete all generated images from my server except those currently used in posts
- Theme Customiser Image Control
- Change the output for [gallery] shortcode
- Get attachment ID of author_meta image – Attachment Metadata
- Associate an existing image with a post
- Excludes posts that don’t have attachments in the_content()
- How can I make all gallery images to open in a new window?
- copy attachment title to description and alt text
- The WordPress Gallery, Grabbing The Link and Images?
- Get an image from url in front end submission form
- Open the attachment details modal
- How to upload image without post ID using the new media uploader?
- How do I delete thousands of unattached images?
- How to force WordPress to add new images at the beginning of the gallery?
- Re-process Images
- Show prev and next post links for parent post of current image in attachment page?
- Get a Page’s attachments in Gallery order
- Make alt text required when setting a featured image
- Why can I not view image attachment pages?
- Add image attachment to post via coding?
- Gallery post images on homepage?
- How to create a simple slideshow out of a post image gallery?
- Link to full size image or attachment page in photo theme
- add the post as canonical for attachment page wordpress
- How to change the target size of images clicked on in WordPress standard gallery
- Exclude featured image from gallery in wp-admin
- Multiple images in one attachment page
- wordpress get gallery images title
- WordPress adds extra width to post images container boxes
- Handling image uploads without thickbox
- Pull images from the gallery
- Retrieve an array of image URLs that belong to a gallery
- Ho to add “Create Slider” option to default “Add Media” popup?
- How to make a gallery with dynamic images from URLs?
- Rewrite all article pictures to link to file
- Creating a post image to show in a gallery
- Don’t show images inserted into content
- Native gallery sorting is ignored
- Using Jetpack carousel w/o creating a gallery [closed]
- Call to undefined function wp_generate_attachment_metadata()
- Load Gallery Images with Title on Homepage BX Slider
- Re-ordering images in existing post in wordpress 3.6.1
- Retrieve Image Attachments Getting Post Thumbnail Image First
- Autosort uploads in galleries by filename
- How to display original unmodified thumbnail
- WordPress Attachments with old images
- How to get image URL from media_sideload_image?
- Show last 12 uploaded images on home page, but only from posts
- How to remove the images from “Uploaded to this post”?
- How to get the next and previous image title from attachment or gallery?
- Pagination between images (active/inactive)
- photo gallery implementation like tmz
- changing the default picture size link url
- Output posts attached images as thumbnails linked to full-size with lightbox class
- How to change an image source when rendering on frontend?
- Allow users to upload and display multiple photos
- How to change Gallery image url in product page ? In function.php?
- How do you obtain a list of all image file names on a wordpress website for replacement?
- Custom image size not displaying with wp_get_attachment_image()
- Images getting smashed
- attachment_fields_to_save first parameter is null
- How to re-arrange images in default WP Gallery more than one image at once?
- Convert multiple image blocks to gallery block in Gutenberg?
- Images 404 after wp migration to a subdomain
- Exclude first image from a Woocommerce image gallery
- How to disable post-thumbnail from generation?
- How to Make Only Images Connected to a Post Show? Not Entire Media Collection?
- Gallery Images could not be shown
- After I upload a file to library its name converted to dashes
- Gallery with shortcode not showing
- Show WordPress Image Title Under Custom Portfolio Image
- Surround uploaded image link with div
- How to display every pictures from all the posts on one page?
- How to add multiple images in a page
- Extract url from next_image_link
- Setting name of attachment URL
- Lots of attachments is causing slow load
- Show title when inserting single images
- Paginate Gallery [closed]
- greater flexibility in targeting images attached to page
- Stop Attachment image names from taking top level permalink
- Getting top Image From the Gallery and printing out a thumbnail with Exact Dimensions
- Adding different classes to different images depending on size for fine control of image layout in posts
- Remove one srcset entry from wp_get_attachment_image
- Attachment tag archive