{"id":10,"date":"2008-05-16T17:32:19","date_gmt":"2008-05-16T22:32:19","guid":{"rendered":"http:\/\/www.cyberward.net\/blog\/?p=10"},"modified":"2008-05-16T15:33:34","modified_gmt":"2008-05-16T20:33:34","slug":"rotating-banner-image","status":"publish","type":"post","link":"http:\/\/www.cyberward.net\/blog\/2008\/05\/rotating-banner-image\/","title":{"rendered":"Rotating Banner Image"},"content":{"rendered":"<p>I got around to creating the rotating banner images last night. I made 3 new ones, but they aren&#8217;t really my best images. I need to hunt round for some others. My flowers don&#8217;t really fit the landscape type space that is there, but I will have to see what I can do.<\/p>\n<p>To make this work, I started out with some javascript in an onLoad function, but the image would blink with either the default image, or the background color. To fix this, I scrapped that idea, and went to an inline style block that is written out with a little php in the header.php file in the template folder.<\/p>\n<pre>&lt;style type=\"text\/css\"&gt;\r\n  #headerLeft {\r\n    background-image: url(&lt;?php bloginfo('stylesheet_directory'); ?&gt;\r\n        \/images\/header-img-&lt;?php echo rand(1,4); ?&gt;.jpg);\r\n  }\r\n&lt;\/style&gt;<\/pre>\n<p>This just gets a number between 1 and 4, and the base directory for the template, and sticks it all together to make the image. Presto. No more flickering.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I got around to creating the rotating banner images last night. I made 3 new ones, but they aren&#8217;t really my best images. I need to hunt round for some others. My flowers don&#8217;t really fit the landscape type space &hellip; <a href=\"http:\/\/www.cyberward.net\/blog\/2008\/05\/rotating-banner-image\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false}}},"categories":[5],"tags":[17,16,15],"series":[],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pffAy-a","jetpack_sharing_enabled":true,"jetpack-related-posts":[],"_links":{"self":[{"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/posts\/10"}],"collection":[{"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/comments?post=10"}],"version-history":[{"count":0,"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/posts\/10\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/media?parent=10"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/categories?post=10"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/tags?post=10"},{"taxonomy":"series","embeddable":true,"href":"http:\/\/www.cyberward.net\/blog\/wp-json\/wp\/v2\/series?post=10"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}