{"id":631,"date":"2010-08-11T21:35:30","date_gmt":"2010-08-12T01:35:30","guid":{"rendered":"http:\/\/www.branchandroot.net\/archive\/"},"modified":"2012-07-16T22:49:54","modified_gmt":"2012-07-17T02:49:54","slug":"fandoms-and-arcs","status":"publish","type":"page","link":"https:\/\/www.branchandroot.net\/archive\/fandoms-and-arcs\/","title":{"rendered":"Fandoms and Arcs"},"content":{"rendered":"<p>Arcs are listed under their series, with brief descriptions of general plot, focal characters, and pairings.  Click on any item to see the stories in that group.<\/p>\n<ul id=\"arc-descriptions\">\n<?php\nglobal $wpdb;\n\n$categories = get_categories(\"exclude=76,77,78,79,420,436,506\");\n$children = array();\nforeach ($categories as $category) {\n\tif ($category->parent) {<br \/>\n\t\t$parent = $category->parent;<br \/>\n\t\t$id = $category->term_id;<br \/>\n\t\tif (! is_array($children[$parent])) { $children[$parent] = array(); }<br \/>\n\t\tarray_push($children[$parent], $category);<br \/>\n\t} \/\/end if has parent<br \/>\n} \/\/end foreach category (indexing)<\/p>\n<p>foreach ($categories as $category) {<br \/>\n\tif ($category->parent == 0) {<br \/>\n\t\techo &#8220;<\/p>\n<li><a href='\".get_category_link( $category->term_id ).&#8221;&#8216;>&#8221;.$category->name.&#8221;<\/a>\n<ul class='children'>&#8220;;<br \/>\n\t\t$thiscat = $category->term_id;<br \/>\n\t\t\/\/print children<br \/>\n\t\tforeach ($children[$thiscat] as $child) {<br \/>\n\t\t\t$thischild = $child->term_id;<br \/>\n\t\t\t\/\/if there are more children, stuff them into a variable now<br \/>\n\t\t\tif ($children[$thischild]) {<br \/>\n\t\t\t\t$morechild = &#8220;<\/p>\n<ul>&#8220;;<br \/>\n\t\t\t\tforeach ($children[$thischild] as $nextchild) {<br \/>\n\t\t\t\t\t$morechild .= &#8220;<\/p>\n<li><a href='\".get_category_link( $nextchild->term_id ).&#8221;&#8216;>&#8221;.$nextchild->name.&#8221;<\/a>: &#8220;.$nextchild->description.&#8221;<\/li>\n<p>&#8220;;<br \/>\n\t\t\t\t} \/\/end foreach 3rd children<br \/>\n\t\t\t\t$morechild .= &#8220;<\/ul>\n<p>&#8220;;<br \/>\n\t\t\t}\/\/ end if third children<br \/>\n\t\t\techo &#8220;<\/p>\n<li><a href='\".get_category_link( $child->term_id ).&#8221;&#8216;>&#8221;.$child->name.&#8221;<\/a>: &#8220;.$child->description.&#8221;&#8221;.$morechild.&#8221;<\/li>\n<p>&#8220;;<br \/>\n\t\t\tunset($morechild);<br \/>\n\t\t}\/\/end  foreach second children<br \/>\n\t\techo &#8220;<\/ul>\n<\/li>\n<p>&#8220;;<br \/>\n\t}\/\/end top level<br \/>\n}\/\/end foreach cat<\/p>\n<p>?>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Arcs are listed under their series, with brief descriptions of general plot, focal characters, and pairings. Click on any item to see the stories in that group.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-631","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/pages\/631","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/comments?post=631"}],"version-history":[{"count":0,"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/pages\/631\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.branchandroot.net\/archive\/wp-json\/wp\/v2\/media?parent=631"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}