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;
}
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.