{"id":1433,"date":"2010-12-16T01:36:43","date_gmt":"2010-12-16T09:36:43","guid":{"rendered":"http:\/\/www.curlybrace.com\/words\/?p=1433"},"modified":"2010-12-17T17:32:45","modified_gmt":"2010-12-18T01:32:45","slug":"wordpress-twentyten-theme-without-header-image","status":"publish","type":"post","link":"https:\/\/www.curlybrace.com\/words\/2010\/12\/wordpress-twentyten-theme-without-header-image\/","title":{"rendered":"WordPress Twentyten Theme Without Header Image"},"content":{"rendered":"<p>The latest version of the Twentyten theme seems to have introduced a bug in the header.  If you opt for no header image, you&#8217;ll end up with a large space and a broken image icon in your header:<\/p>\n<blockquote><p><img decoding=\"async\" src=\"http:\/\/www.curlybrace.com\/words\/wp-content\/uploads\/2010\/12\/WPHeader_RemovedBroken.png\" alt=\"\" title=\"WPHeader_RemovedBroken\" class=\"img-shadow\" \/><\/p><\/blockquote>\n<p>The problem is a conditional in <tt>wp-content\/themes\/twentyten\/header.php<\/tt> which writes out an <tt>img<\/tt> tag even if <tt>get_header_image()<\/tt> returns an empty string:<\/p>\n<pre class=\"brush: php; first-line: 66; gutter: true; highlight: [73]; title: ; notranslate\" title=\"\">   \/\/ Check if this is a post or page, if it has a thumbnail, and if it's a big one\r\n   if ( is_singular() &amp;&amp;\r\n      has_post_thumbnail( $post-&gt;ID ) &amp;&amp;\r\n         ( \/* $src, $width, $height *\/ $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post-&gt;ID ), 'post-thumbnail' ) ) &amp;&amp;\r\n         $image&#x5B;1] &gt;= HEADER_IMAGE_WIDTH ) :\r\n      \/\/ Houston, we have a new header image!\r\n      echo get_the_post_thumbnail( $post-&gt;ID, 'post-thumbnail' );\r\n   else : ?&gt;\r\n      &lt;img src=&quot;&lt;?php header_image(); ?&gt;&quot; width=&quot;&lt;?php echo HEADER_IMAGE_WIDTH; ?&gt;&quot; height=&quot;&lt;?php echo HEADER_IMAGE_HEIGHT; ?&gt;&quot; alt=&quot;&quot; \/&gt;\r\n   &lt;?php endif; ?&gt;<\/pre>\n<p>Replace the else with an elseif which checks to see if the header image string is empty:<\/p>\n<pre class=\"brush: php; first-line: 73; gutter: true; title: ; notranslate\" title=\"\">   elseif ( get_header_image() != &quot;&quot;) : ?&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The latest version of the Twentyten theme seems to have introduced a bug in the header. If you opt for no header image, you&#8217;ll end up with a large space and a broken image icon in your header: The problem &hellip; <a href=\"https:\/\/www.curlybrace.com\/words\/2010\/12\/wordpress-twentyten-theme-without-header-image\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":3,"featured_media":1434,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[15,297],"tags":[],"class_list":["post-1433","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology","category-wordpress"],"_links":{"self":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/1433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/comments?post=1433"}],"version-history":[{"count":22,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/1433\/revisions"}],"predecessor-version":[{"id":1464,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/posts\/1433\/revisions\/1464"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/media\/1434"}],"wp:attachment":[{"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/media?parent=1433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/categories?post=1433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.curlybrace.com\/words\/wp-json\/wp\/v2\/tags?post=1433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}