Title: Add shortcode attributes
Last modified: August 20, 2016

---

# Add shortcode attributes

 *  Resolved [Everlast00](https://wordpress.org/support/users/everlast00/)
 * (@everlast00)
 * [13 years, 2 months ago](https://wordpress.org/support/topic/add-shortcode-attributes/)
 * Hi there! I love your plugin, finally a good one.
 * I have one question though. I would like to extend the shortcode somehow with
   the ability for the user to select the view, like grid view or list view or slideshow.
 * So I’d like to have: [wpsgallery style=”slideshow”].
 * How and what do I change to make this work?
 * To be honest, I only have this atm :p :
 *     ```
       public function shortcode($atts) {
               extract( shortcode_atts( array(
       		'id' => false,
       		'style' => 'Slideshow' // default,
       	), $atts ) );
               return $this->gallery($id);
           }
       ```
   
 * I think I need to change something near line 213:
 * `return '<li><a href="' . $url . '" title="' . $title . '" rel="wpsimplegallery_group_'.
   $post_id . '"><img src="' . $image[0] . '" width="' . $image[1] . '" height="'.
   $image[2] . '" /></a></li>';`
 * Any ideas?
 * [http://wordpress.org/extend/plugins/wp-simple-galleries/](http://wordpress.org/extend/plugins/wp-simple-galleries/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Matthew McConnell](https://wordpress.org/support/users/maca134/)
 * (@maca134)
 * [13 years, 1 month ago](https://wordpress.org/support/topic/add-shortcode-attributes/#post-3583599)
 * Hey
 * The easist way to change the galleries style is change/add css to the themes 
   style.css
 * Most WP themes set the body class to the post type and post-id.
    Eg. `<body class
   ="page page-12">`
 * This allows you to specify styles for certain posttypes/posts

Viewing 1 replies (of 1 total)

The topic ‘Add shortcode attributes’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/wp-simple-galleries_7f8da9.svg)
 * [WP Simple Galleries](https://wordpress.org/plugins/wp-simple-galleries/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-simple-galleries/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-simple-galleries/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-simple-galleries/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-simple-galleries/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-simple-galleries/reviews/)

## Tags

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

 * 1 reply
 * 2 participants
 * Last reply from: [Matthew McConnell](https://wordpress.org/support/users/maca134/)
 * Last activity: [13 years, 1 month ago](https://wordpress.org/support/topic/add-shortcode-attributes/#post-3583599)
 * Status: resolved