Support

Account

Home Forums General Issues Creating an image link with a hover overlay Reply To: Creating an image link with a hover overlay

  • I finally fixed this and just had some stuff in the wrong order. Working code:

    add_action( 'genesis_entry_content', 'bbb_gallery_fields' );
    
    function bbb_gallery_fields() {
    
       if ( have_rows( 'add_an_album' ) ) : ?>
       
       <?php while ( have_rows( 'add_an_album' ) ) : the_row(); ?>
       <div class="album-card">
            <div class="slide slide-top">
            <div class="slide-content"><a class="slide-link" href="<?php the_sub_field( 'link_to_album' ); ?>">View Album</a> </div>
                
            <?php $album_thumbnail = get_sub_field( 'album_thumbnail' ); ?>
    		
    			<?php echo wp_get_attachment_image( $album_thumbnail, 'one-fourth' ); ?>
                </div>
               
                <h2><?php the_sub_field( 'album_title' ); ?></h2>
                </div>          
                                   
            <?php endwhile; ?>
        <?php else : ?>
            <?php // no rows found ?>
        <?php endif; 
    
    }