Support » Plugin: Featured Galleries » Dynamic Post Id for the gallery

  • Resolved mightymente


    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 Kelderic


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

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

    Plugin Author 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.

    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

    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 }


    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 Kelderic


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

    Plugin Author Kelderic


    That’s an awesome front page design btw.

    Thanks …. I resloved my issue…

    Plugin Author 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.