WordPress.org

Ready to get started?Download WordPress

Forums

Radiate
[resolved] Clickable featured images (2 posts)

  1. torprestegard
    Member
    Posted 4 months ago #

    Hi,

    Is threre an easy way to make the three featured images on the front page clickable and linking to the same page as the tekst-link below?

  2. torprestegard
    Member
    Posted 4 months ago #

    I got some help and fixed it. For others wondering about the same:

    If you, in the front-page.php, change this code

    <div class="<?php echo $page_class; ?>">
    				<div class="page_text_container">
    				<?php if ( has_post_thumbnail() ) { the_post_thumbnail(); } ?>
    					<h1 class="entry-title"><a title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    					<?php the_excerpt(); ?><a class="more-link" title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php _e( 'Read more','radiate' ); ?></a>
    				</div>
    			</div>

    with this code

    <div class="<?php echo $page_class; ?>">
            <div class="page_text_container">
    
                    <?php if ( has_post_thumbnail() ) { ?>
    
                    <a href="<?php the_permalink(); ?>">
                            <?php the_post_thumbnail(); ?>
                    </a>
    
                    <?php } ?>
    
                    <h1 class="entry-title"><a title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h1>
    
                    <?php the_excerpt(); ?><a class="more-link" title="<?php the_title_attribute(); ?>" href="<?php the_permalink(); ?>"><?php _e( 'Read more','radiate' ); ?></a>
    
            </div>
    </div>

    it will make the image clickable and take you to the featured page.

    To make this bit more obvious you could do something like this in the Custom CSS

    .home #featured_pages img:hover {
    opacity:0.8;
    }

Reply

You must log in to post.

About this Theme

About this Topic