Title: Gallery Shortcode renders different code in RSS2 feed
Last modified: August 20, 2016

---

# Gallery Shortcode renders different code in RSS2 feed

 *  Resolved [dskbrk](https://wordpress.org/support/users/dskbrk/)
 * (@dskbrk)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/gallery-shortcode-renders-different-code-in-rss2-feed/)
 * Hello,
 * I just noticed that WordPress renders the `[gallery]` shortcode in a different
   way for the RSS2 feed.
 * Instead of `<dl>` & `<dt>` tags there’s a plain link for every image, and it 
   always point to the attachment page (instead of image url), like this:
 *     ```
       <a href='<em>attachment page link</em>' title='X'><img width="210" height="160" src="http://..image.jpg" class="attachment-thumbnail" alt="x" title="x" /></a>
       ```
   
 * There is a way to render the gallery shortcode in the same way as of the standard
   HTML output?
 * I also wonder if there are other difference between HTML and RSS outputs. I can’t
   find anything about this.

Viewing 1 replies (of 1 total)

 *  Thread Starter [dskbrk](https://wordpress.org/support/users/dskbrk/)
 * (@dskbrk)
 * [14 years, 7 months ago](https://wordpress.org/support/topic/gallery-shortcode-renders-different-code-in-rss2-feed/#post-2332542)
 * in **wp-includes/media.php**, **function gallery_shortcode()**, line 811, there’s:
 *     ```
       if ( is_feed() ) {
       		$output = "\n";
       		foreach ( $attachments as $att_id => $attachment )
       			$output .= wp_get_attachment_link($att_id, $size, true) . "\n";
       		return $output;
       	}
       ```
   
 * I solved copying the whole function without those lines in my theme functions.
   php with a different name, then adding:
 * `add_shortcode('gallery', 'gallery_shortcode_fix');`

Viewing 1 replies (of 1 total)

The topic ‘Gallery Shortcode renders different code in RSS2 feed’ is closed to new
replies.

## Tags

 * [gallery](https://wordpress.org/support/topic-tag/gallery/)
 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 1 participant
 * Last reply from: [dskbrk](https://wordpress.org/support/users/dskbrk/)
 * Last activity: [14 years, 7 months ago](https://wordpress.org/support/topic/gallery-shortcode-renders-different-code-in-rss2-feed/#post-2332542)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
