Gallery shortcode does not accept extra values
Support Area › Forums › Authentic › Gallery shortcode does not accept extra values
- This topic has 5 replies, 2 voices, and was last updated 11 years, 10 months ago by Bill Robbins.
-
AuthorPosts
-
January 5, 2013 at 17:58 #8806Guðmundur Karl EinarssonParticipant
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.
January 5, 2013 at 18:07 #8807Bill RobbinsModeratorYou 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,
BillJanuary 5, 2013 at 18:10 #8808Guðmundur Karl EinarssonParticipantThank you Bill for the information. I’ll continue to experiment with this 🙂
January 5, 2013 at 18:16 #8810Bill RobbinsModeratorNo 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.
January 5, 2013 at 18:55 #8811Guðmundur Karl EinarssonParticipantI 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 attachmentsIF (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 🙂
January 7, 2013 at 08:34 #8818Bill RobbinsModeratorFantastic! Thanks for sharing.
-
AuthorPosts
- The topic ‘Gallery shortcode does not accept extra values’ is closed to new replies.