Home image opens the post. Is it possible?

  • Posted in : Read WP
  • luigizanni
    Participant

    Hello!
    I’m using this wonderful template with the masonry style.
    How can I link the image of every post to the article? (It would be perfect to click the image and open the article)

    Actually, if you click on the image, this will be opened in a new window…

    I tried to use the evidence image but it’s not clickable in the home.

    Thank you!

    Mehmet S.
    Keymaster

    Are you talking about featured image?

    luigizanni
    Participant

    yep, if i use the featured image, i can’t click on it in the home. Is there a way to click on the featured in home and redirect the click directly to the post?

    Mehmet S.
    Keymaster

    – Go to Appearance > Editor > blog-masonry.php,

    – Find the below lines:

    <div class="featured-image">
    	<?php
    		the_post_thumbnail( 'blog_feat_img', array( 'alt' => get_the_title(), 'title' => "" ) );
    	?>
    </div>
    

    – Edit them like:

    <div class="featured-image">
    	<a href="<?php the_permalink(); ?>">
    		<?php
    			the_post_thumbnail( 'blog_feat_img', array( 'alt' => get_the_title(), 'title' => "" ) );
    		?>
    	</a>
    </div>
    
    luigizanni
    Participant

    I can’t find that code in the Blog-masonry.php :-(

    What can I do?

    Mehmet S.
    Keymaster

    Sorry try this:

    – Go to Appearance > Editor > format-standard.php.

    luigizanni
    Participant

    Hi Mehmet, found the code and pasted the new one, but it is the same.
    http://www.luigizanni.com :-(

    luigizanni
    Participant

    Mehmet! Wow! It works on the new posts! :-) Thank you for your support. But.. What about the older posts?

    Mehmet S.
    Keymaster

    Your url is forbidden for me.

    luigizanni
    Participant

    :-( The question is that your code works perfectly but only for the new posts and not for the older.
    For example, if I publish an article now, it works. But, it does’nt work on the post I published last week.

    Waiting for your feedback and thank you for all your time! This template rocks.

    luigizanni
    Participant

    I’m here with a professor and he suggested that the problem could be probably a flaw in the loop. What do you think? (I obviously don’t understand nothing :-)

    Mehmet S.
    Keymaster

    Do the above same steps for the other post format files:

    format-aside.php
    format-audio.php
    format-chat.php
    format-gallery.php
    format-image.php
    format-link.php
    format-quote.php
    format-status.php
    format-video.php
    
Viewing 12 posts - 1 through 12 (of 12 total)

You must be logged in and have valid license to reply to this topic.

License required for the following item
Login and Registration Log in · Register