WordPress.org

Ready to get started?Download WordPress

Forums

WP Simple Galleries
[resolved] Add shortcode attributes (2 posts)

  1. Everlast00
    Member
    Posted 1 year ago #

    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/

  2. Matthew McConnell
    Member
    Plugin Author

    Posted 1 year ago #

    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

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic