Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #80537
    Pyrogopher
    Member

    Hi Sakin,

    First off, great theme — nice and simple with some great features, thank you!

    This is probably an easy question that I can’t find the answer to: how can I display the featured image on the post page? Do I need to embed the image separately?

    When I click on the post, I’d like to see similar to what’s on the home page, just with the complete text.

    Thanks!

    #80551
    wensolutions
    Participant

    Hello @Pyrogopher,

    You can easily do that with just some codes. So, first of all create a child theme and copy the file ‘content-single.php’ in the created child theme. After that put the below code in line 14 of ‘content-single.php’. That’s all.

    Note: Reference link for child theme: http://catchthemes.com/blog/create-child-theme-wordpress/

    Thanks!

    #80560
    Sakin
    Keymaster

    @pyrogopher: Sorry I don’t get it what you mean. Can you explain in reference with your site URL.

    All dynamic image that we generate in theme if from Featured Image. So, first make sure you have added in featured image in you post. For featured image, refer to http://catchthemes.com/blog/videos-blog/video-series-adding-featured-image-wordpress-postpage/

    After that you image will be control through settings. For example, if want to display that featured image in archive/blog pages then you need to go to “Appearance => Theme Options => Layout Options” and then select “Excerpt/Blog Display” in Content Layout options.

    Yes, and then if you want to customize any particular post in coding then you need to build child theme like the above solution given by wensolution.

    Thanks

    #108742
    valisann
    Participant

    Hi, what is the code for line 14?
    I try to add the featured image on my blog, for the Full Content Display layout.

    Thanks

    #108816
    Sakin
    Keymaster

    @valisann: Full Content display layout doesn’t show featured image in blog. As this option is used to show the content as it is in the single post. So, you can just add image at the top of post and it will show image in blog.

    So, if you are trying to show featured image in your archive/category/blog page, then you can just just copy content.php file to your child theme, then just add the following code, just below <div class="entry-content">

    <?php if ( has_post_thumbnail() ):?>
    		<a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'catch-evolution' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark">
    		<?php the_post_thumbnail( $imagesize ); ?>
       	</a>
    <?php endif; ?>
    #108925
    valisann
    Participant

    Hi Sakin, thanks for your help. Meanwhile I found myself a solution. I have add the below code in functions.php from my child theme. I also tested your solution and it worked. Thank you.

    function catchflames_post_featured_image() {
    	// Getting data from Theme Options
    	global $post, $wp_query, $catchflames_options_settings;
    	$options = $catchflames_options_settings;
    	$contentlayout = $options['content_layout'];
    	$sidebarlayout = $options['sidebar_layout'];
    
    	$imagesize = '';
    
    	if ( has_post_thumbnail() ) : ?>
            <figure class="featured-image">
                <a>" title="<?php echo esc_attr( sprintf( __( 'Permalink to %s', 'catch-flames' ), the_title_attribute( 'echo=0' ) ) ); ?>">
                    <?php the_post_thumbnail( $imagesize ); ?>
                </a>
            </figure>
       	<?php endif;
Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Show Featured Image on Post Page’ is closed to new replies.