Gallery shortcode does not accept extra values

Support Area Forums Authentic Gallery shortcode does not accept extra values

Tagged: ,

Viewing 6 posts - 1 through 6 (of 6 total)
URL to the page in question:
  • Author
    Posts
  • #8806

    I am using the Authentic theme.

    As a part of trying to resolve a problem with lightboxes I have been trying the [gallery] shortcode.

    I discovered that when using the Authentic theme it is not possible to inlcude other pictures than those uploaded into the post. Furthermore you cannot reorder or change anything else.

    The original wordpress [gallery] shortcode acceps extra values allowing the user to define any images in the gallery, reorder them etc. (http://codex.wordpress.org/Gallery_Shortcode).

    In the file includes/ot-gallery.php the [gallery] shortcode is redefined as to support the gallery included in the authentic theme (OT gallery). This plugin does not seem to accept the values supported in the orignial wordpress gallery.

    #8807
    Bill Robbins
    Moderator

    You are correct. The lightbox gallery that’s part of the Authentic theme is a replacement for the built-in gallery shortcode that’s included with WordPress. It will display all images that have been uploaded on that post and does not take into account the order or exclusions that are set.

    I developed a new lightbox that’s being added to our themes as they’re updated. It doesn’t replace the built-in function, but simply adds a lightbox to it.

    I haven’t had an opportunity to add it to Authentic yet, but I will try to roll that in this next week.

    You can always turn off the current lightbox in the theme options page. It will revert back to the default WordPress gallery.

    If you have any questions, just let me know,
    Bill

    #8808

    Thank you Bill for the information. I’ll continue to experiment with this 🙂

    #8810
    Bill Robbins
    Moderator

    No problem. Sorry I didn’t have a better answer for you just yet. When I experimented with the 3.5 beta I realized I needed to change my gallery as it is now so much easier to add images to a gallery than it used to be.

    #8811

    I actually found a solution to the problem by editing the ot-gallery.php.

    Instead for the code:

    // get attachments
    If (Empty($attr['include'])) // this gallery uses the post attachments
    $attachments = get_children(Array(
    'post_parent' => $attr['id'],
    'exclude' => $attr['exclude'],
    'post_status' => $attr['post_status'],
    'post_type' => $attr['post_type'],
    'post_mime_type' => $attr['post_mime_type'],
    'order' => $attr['order'],
    'orderby' => $attr['orderby'] ));

    Else // this gallery only includes images
    $attachments = get_posts(Array(
    'include' => $attr['include'],
    'post_status' => $attr['post_status'],
    'post_type' => $attr['post_type'],
    'post_mime_type' => $attr['post_mime_type'],
    'order' => $attr['order'],
    'orderby' => $attr['orderby'] ));

    // There are no attachments
    If (Empty($attachments)) return False;

    I changed it to this:

    // get attachments

    IF (isset($attr['ids'])) // Ef ids er skilað
    $attachments = get_posts(Array(
    'include' => $attr['ids'],
    'post_status' => $attr['post_status'],
    'post_type' => $attr['post_type'],
    'post_mime_type' => $attr['post_mime_type'],
    'order' => $attr['order'],
    'orderby' => 'post__in' ));

    ElseIf (Empty($attr['include'])) // this gallery uses the post attachments
    $attachments = get_children(Array(
    'post_parent' => $attr['id'],
    'exclude' => $attr['exclude'],
    'post_status' => $attr['post_status'],
    'post_type' => $attr['post_type'],
    'post_mime_type' => $attr['post_mime_type'],
    'order' => $attr['order'],
    'orderby' => $attr['orderby'] ));

    Else // this gallery only includes images
    $attachments = get_posts(Array(
    'include' => $attr['include'],
    'post_status' => $attr['post_status'],
    'post_type' => $attr['post_type'],
    'post_mime_type' => $attr['post_mime_type'],
    'order' => $attr['order'],
    'orderby' => $attr['orderby'] ));

    // There are no attachments
    If (Empty($attachments)) return False;

    And it works like a charm with your beautiful lightbox 🙂

    #8818
    Bill Robbins
    Moderator

    Fantastic! Thanks for sharing.

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Gallery shortcode does not accept extra values’ is closed to new replies.