Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums Back End Assign Classes to Gallery Images

  • This topic is empty.
Viewing 1 post (of 1 total)
  • Author
    Posts
  • #39766
    realph
    Participant

    So, I’m using the WP Simple Galleries plugin and I was wondering if it’s possible to modify the code to say, if the gallery say has 4 or more images then assign an array of unique classes to each of the images like so:




    Here’s the PHP that returns the gallery:

    private function thumb($id, $post_id) {
    $image = wp_get_attachment_image_src($id, ‘wpsimplegallery_thumb’, true);
    $info = get_posts(array(‘p’ => $id, ‘post_type’ => ‘attachment’));
    return ‘

  • post_title . ‘” rel=”wpsimplegallery_group_’ . $post_id . ‘”>
  • ‘;
    }

    And here’s a link to the complete wp-simple-gallery.php file.

    I’m still trying to grasp PHP, and I’m sure this can this be done using arrays and an if statement of some sort. If anyone could help lead me in the right direction it would be much appreciated.

    Thanks in advance.

Viewing 1 post (of 1 total)
  • The forum ‘Back End’ is closed to new topics and replies.