Guðmundur Karl Einarsson
Forum Replies Created
-
AuthorPosts
-
Guðmundur Karl EinarssonParticipant
Thank you Bill
At first this method did not work as I always got both lightboxes.
But when I removed the is_admin() part is worked allright. The query is now:
if(!is_page(1246) ){
as the 1246 is the page number.
Guð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 🙂
Guðmundur Karl EinarssonParticipantThank you Bill for the information. I’ll continue to experiment with this 🙂
-
AuthorPosts