Echo images or gallery of single place outside of loop or in new theme

This topic contains 1 reply, has 2 voices, and was last updated by  Paolo 8 years, 5 months ago.

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

Open Support Ticket
  • Author
    Posts
  • #60841

    reservemypet
    Expired Member
    Post count: 10

    I managed to add all default and custom fields except this one. I uploaded 5 images to place and need some shortcode or echo image gallery?

    This is example single place. As you see everything is made different than default plugi

    http://reservemypet.com/places/united-states/texas/austin/boarding-1/austin-dogtown-boarding-daycare/

    Please guide me if there is call function or some easy script to take that last part?

    #60899

    Paolo
    Site Admin
    Post count: 31206

    HI,

    you can try with this code:

    
    
          if (geodir_is_page('detail')) {
           $post_images = geodir_get_images($post->ID, 'thumbnail');
            $thumb_image = '';
            if (!empty($post_images)) {
                foreach ($post_images as $image) {
                    $caption = (!empty($image->caption)) ? $image->caption : '';
                    $thumb_image .= '<a href="' . $image->src . '" title="'.$caption.'">';
                    $thumb_image .= geodir_show_image($image, 'thumbnail', true, false);
                    $thumb_image .= '</a>';
                }
            }
       } elseif (geodir_is_page('preview')) {
                 if (isset($post->post_images))
                $post->post_images = trim($post->post_images, ",");
    
            if (isset($post->post_images) && !empty($post->post_images))
                $post_images = explode(",", $post->post_images);
            
            $thumb_image = '';
            if (!empty($post_images)) {
                foreach ($post_images as $image) {
                    if ($image != '') {
                        $thumb_image .= '<a href="' . $image . '">';
                        $thumb_image .= geodir_show_image(array('src' => $image), 'thumbnail', true, false);
                        $thumb_image .= '</a>';
                    }
                }
            }
    echo $thumb_image;
    

    This will output the content of the default Photo tab.

    Let us know how you went,

    Thanks

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

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

Open Support Ticket