• Resolved mightymente

    (@mightymente)


    Hy,
    I am using your plugin and it works great, the only problem i am geting is that i want to use dynamic post id of the posts for fetching gallery .

    $post_id=420; //420 is my post id.
    $galleryArray = get_post_gallery_ids($post_id);

    in place of static post id i want to use dynamic posts id.
    Please help….!!

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Andy Mercer

    (@kelderic)

    Well if you are inside the loop, you can you $post->ID, or get_the_ID().

    Thread Starter mightymente

    (@mightymente)

    I want on whichever post i clicked …..i want its related featured gallery in a lightbox.

    Plugin Author Andy Mercer

    (@kelderic)

    Ah. You’ll need to use a lightbox plugin, or use a theme with a built in lightbox, and then feed the data from Featured Galleries into that plugin.

    Thread Starter mightymente

    (@mightymente)

    I have created lightbox.but i got stuck at one point..i have different featured gallery for each post….I want on which post i clicked i get the featured gallery of only that post.. here is the url the page on which i am working https://mightymente.org/projects/alismidaas/development/demo/

    Here is my code:
    $value=420; // here i want to pass id of a selected post.
    $galleryArray = get_post_gallery_ids($value);
    // print_r ($galleryArray);
    $c = 0;
    foreach ($galleryArray as $id) {
    if ( $c == 0 ){ $class = ‘active’;}
    else{$class = ”;}
    ?>
    <div class=’item <?php echo $class; ?>’ >” class=”img-responsive”></div>
    <?php $c++ ; ?>
    <?php }

    Thread Starter mightymente

    (@mightymente)

    Hy,

    I posted the selected id of the post in ligthbox…

    something like this ,

    $galleryArray = get_post_gallery_ids($_GET[‘dataId’]);

    but my $galleryArray is showing empty ..because it is not getting the selected post id in it …Can you please tell me why this is happening??

    Plugin Author Andy Mercer

    (@kelderic)

    Is this a custom post type that you are looping through, or are you using Posts?

    Plugin Author Andy Mercer

    (@kelderic)

    That’s an awesome front page design btw.

    Thread Starter mightymente

    (@mightymente)

    Hy,
    Thanks …. I resloved my issue…

    Plugin Author Andy Mercer

    (@kelderic)

    Glad to hear it, mighty.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Dynamic Post Id for the gallery’ is closed to new replies.