Jump to content
Sign in to follow this  
agileapricot

Display the_post_thumbnail a the top of a page?

Recommended Posts

agileapricot

I'd like to display the features image at the top of the page. I've tried the following but not been able to get it to work.

	function add_feature_image(){
		echo the_post_thumbnail('medium');
	}
	
	add_action('pagelines_before_maincontent', 'add_feature_image');

Share this post


Link to post
Share on other sites
Andrew

add `global $post;` to the hooked function..

Share this post


Link to post
Share on other sites
agileapricot

You mean like this? Sadly it doesn't seem to work either.

add_action('pagelines_inside_top_theloop', 'addthis');
	
	// function name
	function addthis(){
		global $post;
		echo the_post_thumbnail();
	}
	

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

×