Skip to content

Instantly share code, notes, and snippets.

@spencejs
spencejs / List Child Pages Only
Created March 23, 2013 03:54
List Child Pages Only
<?php
if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) { ?>
<ul class="sectionlist">
<?php echo $children; ?>
</ul>
<?php } ?>
@spencejs
spencejs / Social Links Widget
Created March 22, 2013 06:59
Social Links Widget for Wordpress
@spencejs
spencejs / Highlight Color
Created March 22, 2013 06:25
Text Selection Highlight Color
::selection {
background: #393939;
color:#fff;
}
::-moz-selection {
background: #393939;
color:#fff;
}
@spencejs
spencejs / Son Of Suckerfish
Created March 22, 2013 06:24
Son Of Suckerfish
/*BEGIN Son Of Suckerfish Dropdown*/
.main-nav, .main-nav ul {
padding: 0;
margin: 0;
list-style: none;
}
.main-nav a {
display: block;
@spencejs
spencejs / Responsive Background Images
Created March 22, 2013 06:22
Responsive Background Images
div{
background: url(http://placekitten.com/720/405/) no-repeat center center;
background-size: cover;
height: 0;
padding-bottom: 56.25%; /* 16:9 */
}
@spencejs
spencejs / Image Replacement
Created March 22, 2013 06:20
Image Replacement Of Text
h1{
display:block;
overflow: hidden;
text-indent: 100%;
white-space: nowrap;
}
@spencejs
spencejs / Clip Image To Text
Created March 22, 2013 06:20
Clip Image To Text
h1{
-webkit-mask-image: url(/path/to/mask.png);
-o-mask-image: url(/path/to/mask.png);
-moz-mask-image: url(/path/to/mask.png);
mask-image: url(/path/to/mask.png);
text-shadow: 0 0 30px rgba(30, 28, 28, 0.6);
}
@spencejs
spencejs / Clearfix
Created March 22, 2013 06:18
Clearfix
/* new clearfix */
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content: " ";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */
@spencejs
spencejs / Mark Between Nav Items
Created March 22, 2013 06:17
Add A Mark Between Nav Items
nav li:before { content: "| "; }
nav li:first-child:before { content: ""; }
@spencejs
spencejs / CSS Reset
Created March 22, 2013 06:13
CSS Reset (Based On HTML5 Boilerplate)
html,body,div,span,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,abbr,address,cite,code,del,dfn,em,img,ins,kbd,q,samp,small,strong,sub,sup,var,b,i,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,figure,footer,header,hgroup,menu,nav,section,menu,time,mark,audio,video{border:0;-moz-box-sizing: border-box;-webkit-box-sizing:border-box;box-sizing:border-box;outline:0;font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0}
article,aside,figure,footer,header,hgroup,nav,section{display:block; box-sizing:border-box;}
ul{list-style:inside;}
nav ul{list-style:none}
blockquote,q{quotes:none}
blockquote:before,blockquote:after,q:before,q:after{content:none}
a{font-size:100%;vertical-align:baseline;background:transparent;margin:0;padding:0}
ins{background-color:#ff9;color:#000;text-decoration:none}
mark{background-color:#ff9;color:#000;font-style:italic;font-weight:bold}
del{text-decoration:line-through}