The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

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

  1. Everlast00
    Posted 3 years 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?


  2. Matthew McConnell
    Plugin Author

    Posted 3 years ago #


    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.
    <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

  • WP Simple Galleries
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic