{"id":22879,"date":"2016-06-19T03:01:44","date_gmt":"2016-06-18T17:01:44","guid":{"rendered":"http:\/\/www.rjmprogramming.com.au\/ITblog\/?p=22879"},"modified":"2016-08-19T13:30:04","modified_gmt":"2016-08-19T03:30:04","slug":"wordpress-temporary-user-css-primer-tutorial","status":"publish","type":"post","link":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/","title":{"rendered":"WordPress Temporary User CSS Primer Tutorial"},"content":{"rendered":"<div style=\"width: 230px\" class=\"wp-caption alignnone\"><a title='WordPress Temporary User CSS Primer Tutorial' href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/all-posts\/temporary-user-css\/\"><img decoding=\"async\" style=\"float:left;border: 15px solid pink;\" alt=\"WordPress Temporary User CSS Primer Tutorial\" src=\"http:\/\/www.rjmprogramming.com.au\/HTMLCSS\/temporary_user_css.jpg\" title=\"WordPress Temporary User CSS Primer Tutorial\"  \/><\/a><p class=\"wp-caption-text\">WordPress Temporary User CSS Primer Tutorial<\/p><\/div>\n<p><a target=_blank title='Cascading Style Sheet information from Wikipedia ... thanks' href='https:\/\/en.wikipedia.org\/wiki\/Cascading_Style_Sheets'>CSS<\/a> is, perhaps, best learnt with a varied <i>palette<\/i> to work with, to see how an effect you want to create both &#8230;<\/p>\n<ol>\n<li>works itself, as the concept you want to see &#8230; and &#8230;<\/li>\n<li>interacts with a wide variety of other cascading styling settings, in terms of its robustness, and hierarchy of usefulness &#8230; in other words, your CSS positioning may be very important regarding its workings<\/li>\n<\/ol>\n<p>Today we introduce some functionality that allows you to use this blog, with its default styling as your <i>palette<\/i> as an experimental tool, perhaps, for your CSS testing.<\/p>\n<p>In these terms we try to have your own CSS be last in the order of CSS interpreted by the web browser, but it is really up to you to see for yourself what you need to do to make things happen.<\/p>\n<p>This change involved &#8230; you probably guessed it &#8230; <b><i>tweaking<\/i><\/b> WordPress TwentyTen theme&#8217;s good ol&#8217; header.php &#8230; in <b>two parts<\/b> &#8230;<\/p>\n<p><code><br \/>\n&lt;head&gt;<br \/>\n<b><\/b><br \/>\n\/\/ Lots of other Javascript and CSS work<br \/>\n\/\/ ...<br \/>\n<b><\/b><br \/>\n&lt;style&gt;<br \/>\n<b><\/b><br \/>\n\/\/ Lots of other CSS work<br \/>\n\/\/ ...<br \/>\n<b><\/b><br \/>\n<b><br \/>\n   if (isset($_SESSION['ourcss'])) {<br \/>\n     echo str_replace('&lt;' . 'style&gt;','',str_replace('&lt;' . '\/style&gt;','',$_SESSION['ourcss']));<br \/>\n   } else if (file_exists(\"localcss_\" . my_t_d_server_remote_addr() . \".yzy\")) {<br \/>\n     $lcss = str_replace('&lt;' . 'style&gt;','',str_replace('&lt;' . '\/style&gt;','',file_get_contents((\"localcss_\" . my_t_d_server_remote_addr() . \".yzy\"))));<br \/>\n     $_SESSION['ourcss'] = $lcss;<br \/>\n     echo $lcss;<br \/>\n     unlink(\"localcss_\" . my_t_d_server_remote_addr() . \".yzy\");<br \/>\n   } else if (isset($_GET['cssask'])) {<br \/>\n   } else if (isset($_GET['ourcss'])) {<br \/>\n     $_SESSION['ourcss'] = str_replace('&lt;' . 'style&gt;','',str_replace('&lt;' . '\/style&gt;','',urldecode($_GET['ourcss'])));<br \/>\n     echo $_SESSION['ourcss'];<br \/>\n   } else if (isset($_GET['cssextra'])) {<br \/>\n     $_SESSION['ourcss'] = str_replace('&lt;' . 'style&gt;','',str_replace('&lt;' . '\/style&gt;','',urldecode($_GET['cssextra'])));<br \/>\n     echo $_SESSION['ourcss'];<br \/>\n   } else if (strpos($_SERVER['QUERY_STRING'],'cssextra=')) {<br \/>\n     $sbits=explode(\"cssextra=\", str_replace('#','&',$_SERVER['QUERY_STRING']) . '&');<br \/>\n     $ssbits=explode(\"&\",$sbits[1]);<br \/>\n     $_SESSION['ourcss'] = str_replace('&lt;' . 'style&gt;','',str_replace('&lt;' . '\/style&gt;','',urldecode($ssbits[0])));<br \/>\n     echo $_SESSION['ourcss'];<br \/>\n   } else if (strpos($_SERVER['QUERY_STRING'],'ourcss=')) {<br \/>\n     $sbits=explode(\"ourcss=\", str_replace('#','&',$_SERVER['QUERY_STRING']) . '&');<br \/>\n     $ssbits=explode(\"&\",$sbits[1]);<br \/>\n     $_SESSION['ourcss'] = str_replace('&lt;' . 'style&gt;','',str_replace('&lt;' . '\/style&gt;','',urldecode($ssbits[0])));<br \/>\n     echo $_SESSION['ourcss'];<br \/>\n   }<br \/>\n<\/b><br \/>\n&lt;\/style&gt;<br \/>\n<\/code><\/p>\n<p> &#8230; and &#8230;<\/p>\n<p><code><br \/>\nfunction cookie_fonts() {<br \/>\n<b><\/b><br \/>\n\/\/ Lots of other Javascript Cookie based work helping with control of some user styling settings discussed at ...<br \/>\n\/\/ <a target=_blank title='WordPress User Body Background Primer Tutorial' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-user-body-background-primer-tutorial\/'>https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-user-body-background-primer-tutorial\/<\/a><br \/>\n\/\/ ...<br \/>\n<b><\/b><br \/>\n<b><br \/>\n&lt;?php<br \/>\n   if (isset($_SESSION['ourcss'])) {<br \/>\n     echo \"\\n\" . ' appendtoa(\"cssextra\", \"\" + encodeURIComponent(\"' . $_SESSION['ourcss'] . '\"));  ' . \"\\n\";<br \/>\n   }<br \/>\n?&gt;<br \/>\n<\/b><br \/>\n}<br \/>\n\/\/ ...<br \/>\n\/\/ and then lots more down to (unchanged) end of <i>head<\/i> section and document.body <i>onload<\/i> (where <i>cookie_fonts<\/i>() is the last <i>onload<\/i> functionality) as per ...<br \/>\n\/\/ ...<br \/>\n&lt;\/script&gt;<br \/>\n&lt;\/head&gt;<br \/>\n&lt;body onload=\" setTimeout(initpostedoncc, 3000);  sdescih();  widgetcon(); precc(); courseCookies(); <i>cookie_fonts();<\/i> \" &lt;?php body_class(); ?&gt;&gt;<br \/>\n<\/code><\/p>\n<p id='myownul'>So if you want to try your own CSS try this <a target=_blank title='Click picture' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/all-posts\/temporary-user-css\/'>live run<\/a> link, and see, below, some other suggestions (which simulate what the All Posts -&gt; Temporary User CSS submenu does), that, if you click, and you want to reset use this <a target=_blank title='Reset link' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/?cssextra='>reset link<\/a> here.<\/p>\n<ul>\n<li><a target=_blank title='*{font-family: \"Comic Sans MS\", \"Comic Sans\", cursive;}' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/?cssextra=*%7Bfont-family%3A+%22Comic+Sans+MS%22%2C+%22Comic+Sans%22%2C+cursive%3B%7D%0D%0A'>*{font-family: &#8220;Comic Sans MS&#8221;, &#8220;Comic Sans&#8221;, cursive;}<\/a><\/li>\n<li><a target=_blank title='p{background-color:silver;}' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/?cssextra=p%257Bbackground-color%253Asilver%253B%257D'>p{background-color:silver;}<\/a><\/li>\n<li><a target=_blank title='ul li:nth-child(3):before{background-color: violet;}' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/?cssextra=ul+li%3Anth-child%283%29%3Abefore%7Bbackground-color%3A+violet%3B%7D#myownul'>ul li:<\/a><a target=_blank title='CSS nth-child information' href='https:\/\/css-tricks.com\/how-nth-child-works\/'>nth-child(3)<\/a><a target=_blank title='CSS before property attribute information from w3schools' href='http:\/\/www.w3schools.com\/cssref\/sel_before.asp'>:before<\/a><a target=_blank title='p{background-color:silver;}' href='https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/?cssextra=ul+li%3Anth-child%283%29%3Abefore%7Bbackground-color%3A+violet%3B%7D#myownul'>{background-color: violet;}  \/* violet will show under emoji to left *\/<\/a><\/li>\n<\/ul>\n<p>If this was interesting you may be interested in <a title='Click here to see topics in which you might be interested' href='#d22879' onclick='var dv=document.getElementById(\"d22879\"); dv.innerHTML = \"&lt;iframe width=670 height=600 src=\" + \"https:\/\/www.rjmprogramming.com.au\/ITblog\/tag\/blog\" + \"&gt;&lt;\/iframe&gt;\"; dv.style.display = \"block\";'>this<\/a> too.<\/p>\n<div id='d22879' style='display: none; border-left: 2px solid green; border-top: 2px solid green;'><\/div>\n","protected":false},"excerpt":{"rendered":"<p>CSS is, perhaps, best learnt with a varied palette to work with, to see how an effect you want to create both &#8230; works itself, as the concept you want to see &#8230; and &#8230; interacts with a wide variety &hellip; <a href=\"https:\/\/www.rjmprogramming.com.au\/ITblog\/wordpress-temporary-user-css-primer-tutorial\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12,37],"tags":[151,281,770,932,997,1976,1319,1323,1325,1456],"class_list":["post-22879","post","type-post","status-publish","format-standard","hentry","category-elearning","category-tutorials","tag-blog","tag-css","tag-menu","tag-php","tag-programming","tag-pseudo-class","tag-tutorial","tag-twenty-ten","tag-twentyten-theme","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/22879"}],"collection":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/comments?post=22879"}],"version-history":[{"count":15,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/22879\/revisions"}],"predecessor-version":[{"id":22910,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/posts\/22879\/revisions\/22910"}],"wp:attachment":[{"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/media?parent=22879"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/categories?post=22879"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.rjmprogramming.com.au\/ITblog\/wp-json\/wp\/v2\/tags?post=22879"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}