How can I display the featured images on CourePress theme?

Hi,

I am using CoursePress theme and I can say that I like the theme because it fits perfectly with the Coursepress Pro plugin.

The Courses on my site are displayed in an appealing way http://www.fruitfulujah.com.ng/courses . However the blog styling is less than what I expect http://www.fruitfulujah.com.ng/post/ . I need help to make the featured images appear on the blog post in a similar way the courses are displayed. I am using a child theme of CoursePress that I created.

Thanks for your usual support.

  • Bojan Radonic
    • Head of Support

    Hey there @Sefa, hope you're well today!

    I've quickly tested this on my installation and it appears that the functionality to use featured images on both post archive and single post page has not been added to the theme.

    Since this is one of the fundamental features of any theme I'll add this as a feature request so it can be implemented in the theme in one of the future versions of it.

    Best regards,
    Bojan

  • Bojan Radonic
    • Head of Support

    Hey again @Sefa,

    Adding this as a featured request doesn't mean the functionality will be added in the next update but rather one of the future ones and unfortunately we do not provide ETAs on the updates and feature releases so we can avoid possible disappointment if any delay happen.

    Best regards,
    Bojan

  • Hoang Ngo
    • Code Slayer

    Hi @Sefa,

    I hope you are well today.

    For adding the feature image to single & archive post, we will need to use this code

    if ( has_post_thumbnail() ) {
                the_post_thumbnail();
            }

    Example for the single page /wp-content/themes/coursepress/content-single.php, line 8, you can see a code block like this

    <header class="entry-header">
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    
    		<div class="entry-meta">
    			<?php coursepress_posted_on(); ?>
    		</div><!-- .entry-meta -->
    	</header><!-- .entry-header -->

    Please change it to

    <header class="entry-header">
    		<h1 class="entry-title"><?php the_title(); ?></h1>
    
    		<div class="entry-meta">
    			<?php coursepress_posted_on(); ?>
    		</div><!-- .entry-meta -->
    	</header><!-- .entry-header -->
        <?php
        if ( has_post_thumbnail() ) {
            the_post_thumbnail();
        }
        ?>

    The feature image now will show up below the post title.
    Similar for the archive page, file /wp-content/themes/coursepress/content.php line 9, you will see a code block like this
    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
    Please update it to

    <h1 class="entry-title"><a href="<?php the_permalink(); ?>" rel="bookmark"><?php the_title(); ?></a></h1>
            <?php
            if ( has_post_thumbnail() ) {
                the_post_thumbnail();
            }
            ?>

    Now in the archive, feature image show up too :slight_smile:

    Let's see if it can help you :slight_smile:

    Best regards,
    Hoang

  • Sefa
    • Flash Drive

    Sweet. It worked.

    Thank you very much. I look forward to when this is officially added to the theme with a bit of styling to make it look like how the courses are displayed on the theme. That would complete the theme.
    I like the theme. :slight_smile:

    Thanks,
    Sefa

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.