• Resolved nerraw

    (@nerraw)


    Hi,
    I would like to request to make the Blog to show featured image instead of just the title and some description.

Viewing 9 replies - 1 through 9 (of 9 total)
  • WEN Solutions

    (@wen-solutions)

    Did you set the featured image on each post?

    Thread Starter nerraw

    (@nerraw)

    Yes.

    Tanay

    (@tanaykhandelwal-1)

    Hi nerraw,
    Hope you’re doing well:)

    Yes you can show the featured image on front and to do this you just need to open invert-front-page.php and replace the code between line 58 to 64 with below.

    <!-- the loop -->
    <?php while ( $invert_lite_latest_loop->have_posts() ) : $invert_lite_latest_loop->the_post(); ?>
    	<div class="span4">
    		<?php if ( has_post_thumbnail() ) { the_post_thumbnail('medium'); } ?>
    		<h2><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a></h2>
    		<?php the_excerpt(); ?>
    		<div class="continue"><a href="<?php the_permalink(); ?>"><?php _e('Read More &rarr;','invert-lite');?></a></div>
    	</div>
    <?php endwhile; ?>
    <!-- end of the loop -->

    Best,
    Tanay Khandelwal

    Thread Starter nerraw

    (@nerraw)

    I will try that codes, and I want to thank you in advance for your time. I really appreciated it.

    WEN Solutions

    (@wen-solutions)

    There is no functionality for retrieve featured image on blog post. You have to add the below code on invert-front-page.php file below the line 59.

    <?php the_post_thumbnail(); ?>

    Note: Child theme is recommended to customize theme.
    Thanks

    Thread Starter nerraw

    (@nerraw)

    Hi Tanay,

    The code you have posted works!

    Thank you very much for your help.

    Thread Starter nerraw

    (@nerraw)

    Hi,

    I have a follow up question, is it possible to automatically set it to a static size of image? So all images are at the same size.

    Thanks.

    Tanay

    (@tanaykhandelwal-1)

    Hi,

    First of all I want to say is “Yes, Child theme is recommended to customize theme.”
    Thanks @WEN_Solutions for reminding us.

    Now, about your query nerraw, add this line in function.php line 101. you can replace the 370, 400 with your image choice

    add_image_size('invert-front-thumb', 370, 400, true);

    then replace the line in previous code

    the_post_thumbnail('medium');

    with

    the_post_thumbnail('invert-front-thumb');

    Mark ticket resolved if you get the solution.

    Best,
    Tanay Khandelwal

    Thread Starter nerraw

    (@nerraw)

    Thank you guys!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Show Blog Featured Image’ is closed to new replies.