Title: Custom [gallery] shortcode markup
Last modified: August 19, 2016

---

# Custom [gallery] shortcode markup

 *  Resolved [nnash](https://wordpress.org/support/users/nnash/)
 * (@nnash)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/custom-gallery-shortcode-markup/)
 * I’m currently in the process of outfitting nivo-slider to work with gallery images
   from posts. I’m using the below code in conjunction with the Cleaner Gallery 
   WordPress plugin.
 *     ```
       <?php
       echo do_shortcode('[gallery]');
       ?>
       ```
   
 *  The issue I’m running into is that the gallery shortcode is adding all of this
   markup that I **do not** want. What I would like to know is if it is possible
   to strip the html markup that is associated with the following classes from being
   parsed.
 *     ```
       .gallery {}
       .gallery .gallery-row {}
       .gallery .gallery-item {}
       .gallery .gallery-item img, .gallery .gallery-item img.thumbnail {}
       .gallery-caption {}
       ```
   
 * All that I want to be injected into the markup are a simple, non-listed set of
   images from the gallery like so:
 *     ```
       <img src="foo" alt="bar" width="0" height="0" />
       <img src="foo" alt="bar" width="0" height="0" />
       <img src="foo" alt="bar" width="0" height="0" />
       ```
   
 * Any help would be greatly appreciated, thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [nnash](https://wordpress.org/support/users/nnash/)
 * (@nnash)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/custom-gallery-shortcode-markup/#post-1590272)
 * bump
 *  Thread Starter [nnash](https://wordpress.org/support/users/nnash/)
 * (@nnash)
 * [15 years, 10 months ago](https://wordpress.org/support/topic/custom-gallery-shortcode-markup/#post-1590318)
 * Actually instead of figuring out how to remove the unnecessary markup from wordpress’s
   shortcodes it is easier to just make your own.
 * This resource helped me:
    [http://www.aldenta.com/2009/05/05/programmatically-pull-attachments-from-wordpress-posts/](http://www.aldenta.com/2009/05/05/programmatically-pull-attachments-from-wordpress-posts/)

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Custom [gallery] shortcode markup’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 2 replies
 * 1 participant
 * Last reply from: [nnash](https://wordpress.org/support/users/nnash/)
 * Last activity: [15 years, 10 months ago](https://wordpress.org/support/topic/custom-gallery-shortcode-markup/#post-1590318)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
