{"id":305,"date":"2005-05-07T18:37:02","date_gmt":"2005-05-07T15:37:02","guid":{"rendered":"http:\/\/www.all-things-me.net\/blog\/archives\/2005\/05\/07\/random-cuteness"},"modified":"2010-08-12T01:14:43","modified_gmt":"2010-08-11T22:14:43","slug":"random-cuteness","status":"publish","type":"post","link":"https:\/\/www.all-things-me.net\/blog\/2005\/05\/07\/random-cuteness","title":{"rendered":"Random cuteness"},"content":{"rendered":"<p>I made a random header image script for <a href=\"<?php echo get_category_link('20'); ?>&#8220;>Ami&#8217;s<\/a> site today. The purple ball of yarn photo is still my all time favourite, but Ami is always so cute and cuddly that I wanted to put more images there. The script is very simple:<\/p>\n<blockquote class=\"php\"><p>&lt;?php \/\/ Random header image<br \/>\n\/* there are 3 pictures to choose from, so number is either 0, 1 or 2 *\/<br \/>\n$i = rand(0,2);<br \/>\nif ( $i == 0 ) { ?&gt;<br \/>\n&nbsp;&nbsp;&lt;img src=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;); ?&gt;\/images\/header_01.jpg&#8221; alt=&#8221;Caramel Ears&#8221; \/&gt;<br \/>\n&lt;?php } else if ( $i == 1 ) { ?&gt;<br \/>\n&nbsp;&nbsp;&lt;img src=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;); ?&gt;\/images\/set2\/header_01.jpg&#8221; alt=&#8221;Caramel Ears&#8221; \/&gt;<br \/>\n&lt;?php } else if ( $i == 2 ) { ?&gt;<br \/>\n&nbsp;&nbsp;&lt;img src=&#8221;&lt;?php bloginfo(&#8216;template_directory&#8217;); ?&gt;\/images\/set3\/header_01.jpg&#8221; alt=&#8221;Caramel Ears&#8221; \/&gt;<br \/>\n&lt;?php } ?&gt;<\/p><\/blockquote>\n<p>As there is also the horizontal menu that has part of the image as a background, I had to move that bit of CSS from the style sheet file to the index file:<\/p>\n<blockquote class=\"php\"><p>&lt;div id=&#8221;nav&#8221; style=&#8221;background-image:url(&lt;?php bloginfo(&#8216;template_directory&#8217;); ?>\/images\/&lt;?php if ($i == 1) { ?&gt;set2\/&lt;?php } else if ($i == 2 ) { ?&gt;set3\/&lt;?php } ?&gt;header_02.jpg);&#8221;&gt;<\/p><\/blockquote>\n<p>That&#8217;s a bit crammed but I didn&#8217;t want to make it as long and elaborate as for the header image.<\/p>\n<p>Anyway, this post wasn&#8217;t about my amazing coding abilities <img src=\"https:\/\/www.all-things-me.net\/blog\/wp-includes\/images\/smilies\/icon_razz.gif\" alt=\":razz:\" class=\"wp-smiley\" style=\"height: 1em; max-height: 1em;\" \/> but the pictures: <a href=\"\/ami\/\">GO SEE!<\/a> [site has been removed]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I made a random header image script for<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,21],"tags":[],"class_list":["post-305","post","type-post","status-publish","format-standard","hentry","category-amadeus","category-web-design"],"_links":{"self":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts\/305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/comments?post=305"}],"version-history":[{"count":2,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions"}],"predecessor-version":[{"id":1425,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/posts\/305\/revisions\/1425"}],"wp:attachment":[{"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/media?parent=305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/categories?post=305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.all-things-me.net\/blog\/wp-json\/wp\/v2\/tags?post=305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}