Support » Themes and Templates » featured image on single post

Viewing 2 replies - 1 through 2 (of 2 total)
  • Michael


    Forum Moderator

    the above code is not usable –
    please post your code again and mark it properly –



    I dont really know what you mean, but this is also some code in relation to thumbnail post from the functions.php file.

    function cs_get_post_img($post_id, $width, $height){
    	//if ( has_post_thumbnail()) {}
    	$image_id = get_post_thumbnail_id($post_id);
    	$image_url = wp_get_attachment_image_src($image_id, array($width,$height),true);
    	if ( $image_url[1] == $width and $image_url[2] == $height ) {
    		return get_the_post_thumbnail($post_id, array($width, $height));
    	else {
    		return get_the_post_thumbnail($post_id,"full");

    [Moderator Note: Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘featured image on single post’ is closed to new replies.