[Resolved] How to use original size image for header as Twenty Twelve does?
I’m trying to port Twenty Eleven custom header for post/page feature to Twenty Twelve. I combined the code from both themes in header.php, but for some reason post/page header is inserted as Large, not as original as Twenty Twelve does. Here is the original Twenty Twelve code:
Here is my header.php code:
Looks like this part is responsible:
if ( is_singular() && has_post_thumbnail( $post->ID ) && ( /* $src, $width, $height */ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), array( $header_image_width, $header_image_width ) ) ) && $image >= $header_image_width ) : // Houston, we have a new header image! echo get_the_post_thumbnail( $post->ID, 'post-thumbnail' );
What should I change so I could get the output with image of full size and without width and height specified?
Also in Twenty eleven code the part
array( $header_image_width, $header_image_width )looks like mistake, because width is written twice, unless there is some kind of hack.
Here is the default header – works OK:
Post/page header is inserted as Large:
Thank you for your help!
- The topic ‘[Resolved] How to use original size image for header as Twenty Twelve does?’ is closed to new replies.