• Resolved calagnet

    (@calagnet)


    How can I get each carousel featured image to link to the blog post instead of just the title at the bottom? This format is really not very user friendly, since the image changes slightly on hover giving it the appearance of a link.

Viewing 2 replies - 1 through 2 (of 2 total)
  • paweld3

    (@paweld3)

    I have the same problem.

    Hi there,

    You need to edit /inc/slider.php using a child theme, and then find the following piece of code:

    <div class="slide">
    	<?php if ( has_post_thumbnail() ) : ?>
    		<?php the_post_thumbnail( 'oria-carousel' ); ?>
    	<?php else : ?>
    		<?php echo '<img src="' . get_stylesheet_directory_uri() . '/images/placeholder.png"/>'; ?>
    	<?php endif; ?>
    	<?php the_title( sprintf( '<h3 class="slide-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); ?>
    </div>

    with the following:

    <div class="slide">
    	<?php if ( has_post_thumbnail() ) : ?>
    		<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark"><?php the_post_thumbnail( 'oria-carousel' ); ?></a>
    	<?php else : ?>
    		<a href="<?php echo esc_url( get_permalink() ); ?>" rel="bookmark"><?php echo '<img src="' . get_stylesheet_directory_uri() . '/images/placeholder.png"/>'; ?></a>
    	<?php endif; ?>
    	<?php the_title( sprintf( '<h3 class="slide-title"><a href="%s" rel="bookmark">', esc_url( get_permalink() ) ), '</a></h3>' ); ?>
    </div>

    Let us know if it works. ??

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Carousel Featured Images Link’ is closed to new replies.