WordPress.org

Forums

discover
[resolved] Can't see Featured Image for my post that's in a Category (8 posts)

  1. thagh0st
    Member
    Posted 1 year ago #

    Hello,

    I am having a problem getting the featured image to show up when I put up a post inside one of my categories. It shows up on the main page, but not within the category I insert it into. Is there any way to make the featured image of my post to show?

    Thank You,
    Jason

  2. Jesin A
    Member
    Posted 1 year ago #

    Hi Jason,

    Do you mean the thumbnail shows on example.com but doesn't show up on example.com/category/somename/ ?

    This could be because the category.php or archive.php file of your template doesn't have the function the_post_thumbnail() which displays the thumbnail image.

  3. thagh0st
    Member
    Posted 1 year ago #

    Thank you for the suggestion. Is it possible to add the function? Would it be possible in this theme? If so, where would I add it?

  4. Jesin A
    Member
    Posted 1 year ago #

    Yes it is very much possible to add that function. If you can post the name of the theme you are using I'd be able to direct you.

    If it was obtained outside wordpress's theme directory then also mention that website.

  5. thagh0st
    Member
    Posted 1 year ago #

    Thank you again, the name of the theme is Discover.

  6. Jesin A
    Member
    Posted 1 year ago #

    Open the file /document/root/wp-content/themes/discover/loop.php find the following line

    <?php if ( is_archive() || is_search() ) : ?>

    this is on line no 30. Add the following code after this line

    <?php if ( has_post_thumbnail() ) { ?> <div class="entry-thumbnail"> <?php the_post_thumbnail(array(620,240)); ?> </div> <?php } ?>

    Originally it was like this

    <?php if ( is_archive() || is_search() ) :  ?>
    
    		<?php the_content( '<span class="read-more">'.__('Read More', 'discover').'</span>' ); ?>
    		<div class="clear"></div>
    		<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'discover' ), 'after' => '' ) ); ?>

    after the addition it should look like this

    <?php if ( is_archive() || is_search() ) :  ?>
    	<?php if ( has_post_thumbnail() ) { ?> <div class="entry-thumbnail"> <?php the_post_thumbnail(array(620,240)); ?> </div> <?php } ?>
    		<?php the_content( '<span class="read-more">'.__('Read More', 'discover').'</span>' ); ?>
    		<div class="clear"></div>
    		<?php wp_link_pages( array( 'before' => '' . __( 'Pages:', 'discover' ), 'after' => '' ) ); ?>
  7. thagh0st
    Member
    Posted 1 year ago #

    Jesin, I finally got it to work. Thank you very much for your help!

  8. Jesin A
    Member
    Posted 1 year ago #

    Most welcome Jason.

    Please change this thread to resolved.

Topic Closed

This topic has been closed to new replies.

About this Theme

About this Topic

Tags

No tags yet.