Skip to content

Instantly share code, notes, and snippets.

View nicksatkovich's full-sized avatar

Nick Satkovich nicksatkovich

View GitHub Profile
<?php
$args = array( 'taxonomy' => 'product_cat', 'child_of' => 16, 'exclude_tree' => 15 );
$terms = get_terms('product_cat', $args);
$count = count($terms); $i=0;
if ($count > 0) {
//$cape_list = '<p class="my_term-archive">';
foreach ($terms as $term) {
$i++;
<script type="text/javascript">
$(function () {
$('.countdown').countdown({until: new Date(2013, 2-1, 1)});
});
</script>
<?php
$type = array('post', 'portfolio');
$args=array(
'post_type' => $type,
'post_status' => 'publish',
'paged' => $paged,
//'orderby'=> title,
'orderby' => 'rand',
'order' => 'ASC',
'posts_per_page' => 9, // -1 shows all posts
<script type="text/javascript">
$(document).ready(function() {
noty({"text":"Hi!","layout":"top","type":"error","textAlign":"center","easing":"swing","animateOpen":{"height":"toggle"},"animateClose":{"height":"toggle"},"speed":"500","timeout":false,"closable":true,"closeOnSelfClick":true});
}
</script>
<ul>
<li><a href="#"><img src="#" alt=""><span>Trending</span></a></li>
</ul>
.children {display: none; margin: 0 0 20px 0;}
nav#secondary ul li.current_page_item .children {display: block;}
nav#secondary ul li.current_page_parent .children {display: block;}
<?php
if (!$post->post_parent) {
$children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
} else {
$p = end(get_post_ancestors($post->ID));
<?php if (!is_category): ?>
<?php query_posts('cat=-8'); ?>
<?php endif; ?>
.tooltip {display: none; background-color: #ffa; border: 1px solid #cc9; color: #333366; font-weight: bold !important; padding: 3px; font-size: 12px; -moz-box-shadow: 2px 2px 11px #666; -webkit-box-shadow: 2px 2px 11px #666;}
add_filter( 'pre_get_posts', 'my_get_posts' );
function my_get_posts( $query ) {
if ( is_home() )
$query->set( 'post_type', array( 'post', 'page', 'album', 'movie', 'quote', 'attachment' ) );
return $query;
}