I got this custom portfolio php file here:
or you can see it below at the end of the question...
The problem is that I can't manage to show the image title. I tried different ways but I can't manage to make it work. Always all the images shows the same title from the first attached image when I want that every image on the portfolio page to show their exact title. not the same one with the first attached one.
The tile of the image goes in the line 57
Any suggestions?
<?php
if($grid_gallery == "1 column"){
$portfolio_container = "container-24";
$portfolio_category = true;
$portfolio_img_w = 1000;
$portfolio_img_h = 300;
} elseif ($grid_gallery == "2 columns") {
$portfolio_container = "container-12";
$portfolio_category = true;
$portfolio_img_w = 500;
$portfolio_img_h = 300;
} elseif ($grid_gallery == "3 columns") {
$portfolio_container = "container-8";
$portfolio_small_tag = "-small";
$portfolio_img_w = 500;
$portfolio_img_h = 300;
} elseif ($grid_gallery == "4 columns") {
$portfolio_container = "container-6";
$portfolio_small_tag = "-small";
$portfolio_img_w = 193;
$portfolio_img_h = 112;
}
$gallery_images = json_decode(htmlspecialchars_decode(get_post_meta(get_the_ID(), 'glocal_company_gallery', true)));
$count_arr = count((array)$gallery_images);
if(is_object($gallery_images) && $count_arr >= 1) :
$i = 1;
$k = 1;
foreach($gallery_images as $_img) { if($k == $i) { $main = wp_get_attachment_image_src($_img); } $k++; }
$k = 1;
foreach($gallery_images as $_img) :
$image = wp_get_attachment_image_src($_img, 'full'); ?>
<div class="portfolio-container <?php echo $portfolio_container; ?>">
<div class="portfolio-listing<?php echo $portfolio_small_tag; ?> block">
<div class="portfolio-image">
<a href="<?php echo $image[0] ?>" class="portfolio-enlarge">
<img src="<?php echo vt_resizer($image[0], $portfolio_img_w, $portfolio_img_h); ?>" alt="<?php the_title() ?>" title="<?php the_title(); ?>" />
</a>
</div>
<?php if($portfolio_category == true): ?>
<div class="portfolio-description development clearfix">
<div class="portfolio-title-category">
<div class="portfolio-title"><?php the_title() ?></div>
<div class="portfolio-category text-colorful"><?php echo __('Portfolio','glocal_site'); ?></div>
</div>
<a href="<?php echo $image[0] ?>" class="portfolio-enlarge" target="_blank"></a>
</div>
<?php else: ?>
<div class="portfolio-title">
<a href="<?php echo $image[0] ?>" class="portfolio-enlarge">
TITLE GOES HERE
</a>
</div>
<?php endif; ?>
</div>
</div>
<?php $k++;
endforeach;
endif;