how to display the first 4 thumbnails of the photo gallery

This topic contains 3 replies, has 2 voices, and was last updated by  Stiofan O’Connor 7 years, 4 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #392781

    Fabrizio Fabri
    Expired Member
    Post count: 71

    Hi support

    I am using whoop and I would like to display the first 4 thumbnails of the photo gallery right above the Tabs section in the Event Details Page. I know which hook to use and in the forum I found this snippet that display ALL the thumbnails:

    add_action(‘geodir_event_details_main_content’, ‘geodir_detail_page_images_hc’, 51);

    function geodir_detail_page_images_hc() {
    global $post, $post_images;
    $post_images = geodir_get_images($post->ID,’thumbnail’);
    $thumb_image = ”;
    if(!empty($post_images)){
    $thumb_image .= ‘<div id=”geodir-post-gallery” class=”clearfix”>’;
    foreach($post_images as $image){
    $thumb_image .= ‘src.'”>’;
    $thumb_image .= geodir_show_image($image,’thumbnail’,true,false);
    $thumb_image .= ‘
    ‘;
    }
    $thumb_image .= ‘</div>’;
    }
    echo $thumb_image;
    }

    Please could you tell me how to modify it to display only the first 4?
    NOTE that when the gallery opens it must work as usual showing ALL the photos (not only the first 4).

    Thanks a lot
    Fabrizio

    #392885

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #392929

    Fabrizio Fabri
    Expired Member
    Post count: 71

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

    #392995

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    A valid license is required to view this reply.

    You may need to login

    OR

    Buy either a Membership or valid license for this product.

    Thanks, Team GeoDirectory!

Viewing 4 posts - 1 through 4 (of 4 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount