Featured image each page


#1

How to show featured image above each single post page (not home page)


#2

Hello Nestrosu,

Add following code in your functions.php file,

function rtp_single_post_thumb() {  
    if ( ( ! is_home() || ! is_front_page() ) && ( is_singular() && has_post_thumbnail() ) ) {  
        echo '';  
        the_post_thumbnail( 'full' );  
        echo '';  
    }  
}  

add_action( 'rtp_hook_begin_post_content', 'rtp_single_post_thumb' );  

In above code, is_singular() will check if current page is single post or single page and the_post_thumbnail() function will display featured image on single post OR page.


#3

Awesome it works .. thank you


#4

Glad to know it works for you.

Thanks for using rtPanel :)


#5

rtpanel is something i was looking for a long time .. also thank you guys for creating this awesome framework


#6

@nestrosu

Glad to know your issue got solved. I am closing this support thread. If you face any other issue in future, please create another thread.


#7