• Resolved torprestegard

    (@torprestegard)


    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?

Viewing 1 replies (of 1 total)
  • Thread Starter torprestegard

    (@torprestegard)

    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;
    }

Viewing 1 replies (of 1 total)
  • The topic ‘Clickable featured images’ is closed to new replies.