• Resolved sermalefico

    (@sermalefico)


    The ALT and title field is not displayed. The other fields work. Is there any way to get it displayed?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Navneil Naicker

    (@navzme)

    Please show me the code you are using

    Thread Starter sermalefico

    (@sermalefico)

    <?php
    $ido = get_the_ID();

    $post = get_post($ido);
    $slug = $post->post_name;

    $images = acf_photo_gallery(‘galeria’, $post->ID);
    $thumbnail_id = get_post_thumbnail_id( $post->ID );
    $alt = get_post_meta($thumbnail_id, ‘_wp_attachment_image_alt’, true);
    ?>
    <div class=”galeria-biografia swiper-container”>
    <div class=”swiper-wrapper”>
    <div class=”swiper-slide”>
    <div class=”thumbnail”>” data-caption=”<?php echo $alt;?>” data-fancybox=”gallery-<?php echo $slug; ?>” > <?php echo get_the_post_thumbnail($ido,’thumbnail’,$attr); ?>

    </div></div>
    <?php foreach( $images as $image ):

    $id = $image[‘id’];
    $alt = get_field(‘photo_gallery_alt’, $id); //Get the alt which is a extra field (See below how to add extra fields)
    $class = get_field(‘photo_gallery_class’, $id);
    $full_image_url= $image[‘full_image_url’]; //Full size image url
    $full_image_url2 = acf_photo_gallery_resize_image($full_image_url, 150, 150); //Resized size to 262px width by 160px height image url
    ?>
    <div class=”swiper-slide”>
    <div class=”thumbnail”>
    ” data-caption=”<?php echo $alt;?>” data-fancybox=”gallery-<?php echo $slug; ?>”>
    ” alt=”<?php echo $title; ?>” title=”<?php echo $title; ?>”>

    </div>

    </div>
    <?php endforeach; ?>
    </div>
    <!– If we need pagination –>
    <div class=”swiper-pagination”></div>

    <!– If we need navigation buttons –>
    <div class=”swiper-button-prev”></div>
    <div class=”swiper-button-next”></div>
    </div>
    <?php // ?>

    Thread Starter sermalefico

    (@sermalefico)

    <?php
    $ido = get_the_ID();
    
    $post = get_post($ido); 
    $slug = $post->post_name;
    
     $images = acf_photo_gallery('galeria', $post->ID);
    $thumbnail_id = get_post_thumbnail_id( $post->ID );
    $alt = get_post_meta($thumbnail_id, '_wp_attachment_image_alt', true);
     ?>
        <div class="galeria-biografia swiper-container">
    <div class="swiper-wrapper">
     <div class="swiper-slide">
     <div class="thumbnail"><a href="<?php the_post_thumbnail_url($ido,'medium'); ?>"  data-caption="<?php echo $alt;?>" data-fancybox="gallery-<?php echo $slug; ?>" > <?php echo get_the_post_thumbnail($ido,'thumbnail',$attr); ?>
    	
    </a></div></div>
            <?php foreach( $images as $image ): 
    
    $id = $image['id'];
    $alt = get_field('photo_gallery_alt', $id); //Get the alt which is a extra field (See below how to add extra fields)
                $class = get_field('photo_gallery_class', $id); 
    $full_image_url= $image['full_image_url']; //Full size image url
                $full_image_url2 = acf_photo_gallery_resize_image($full_image_url, 150, 150); //Resized size to 262px width by 160px height image url
    ?>
                 <div class="swiper-slide">
     <div class="thumbnail">
    <a href="<?php echo $full_image_url; ?>" data-caption="<?php echo $alt;?>" data-fancybox="gallery-<?php echo $slug; ?>">
                <img src="<?php echo $full_image_url2; ?>" alt="<?php echo $title; ?>" title="<?php echo $title; ?>"></a>
         
        </div>
    
     
                </div>
            <?php endforeach; ?>
        </div>
     <!-- If we need pagination -->
        <div class="swiper-pagination"></div>
    
        <!-- If we need navigation buttons -->
        <div class="swiper-button-prev"></div>
        <div class="swiper-button-next"></div>
     </div>
    <?php // ?>
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘The ALT and title field is not displayed.’ is closed to new replies.